Fix blocks overlapping in rare cases when coming from a page with a single block
This commit is contained in:
@@ -120,9 +120,14 @@ export default {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler (blocks) {
|
||||
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 }
|
||||
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 }
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user