From 64b7d6bb4f7dab56bb75c13f022f5213a0549d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Wed, 19 Apr 2023 19:35:43 +0200 Subject: [PATCH] Fix record modal not showing page --- .../compose/src/components/Common/Grid.vue | 23 ++++++++++++------- .../src/components/Public/Record/Modal.vue | 10 ++++---- .../src/views/Public/Pages/Records/View.vue | 4 ++-- .../compose/src/views/Public/Pages/View.vue | 1 - 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/client/web/compose/src/components/Common/Grid.vue b/client/web/compose/src/components/Common/Grid.vue index 42a4048f9..636596c22 100644 --- a/client/web/compose/src/components/Common/Grid.vue +++ b/client/web/compose/src/components/Common/Grid.vue @@ -120,15 +120,22 @@ export default { immediate: true, deep: true, handler (blocks) { - this.layout = [] - - // Next tick is important, otherwise it can lead to overlapping blocks - this.$nextTick(() => { - this.layout = blocks.map(({ meta, xywh: [x, y, w, h] }, i) => { - // To avoid collision with hidden elements - return meta.hidden ? { i, x: 0, y: 0, w: 0, h: 0 } : { i, x, y, w, h } - }) + blocks = blocks.map(({ meta, xywh: [x, y, w, h] }, i) => { + // To avoid collision with hidden elements + return meta.hidden ? { i, x: 0, y: 0, w: 0, h: 0 } : { i, x, y, w, h } }) + + // Only use next tick if previous layout exists + if (this.layout.length) { + this.layout = [] + + // Next tick is important, otherwise it can lead to overlapping blocks + this.$nextTick(() => { + this.layout = blocks + }) + } else { + this.layout = blocks + } }, }, }, diff --git a/client/web/compose/src/components/Public/Record/Modal.vue b/client/web/compose/src/components/Public/Record/Modal.vue index 9cbf58137..452cd50d7 100644 --- a/client/web/compose/src/components/Public/Record/Modal.vue +++ b/client/web/compose/src/components/Public/Record/Modal.vue @@ -22,7 +22,7 @@ :page="page" :module="module" :record-i-d="recordID" - :show-record-modal="showModal" + show-record-modal />