diff --git a/src/components/Editor.vue b/src/components/Editor.vue index da46735e71..d6a3482cc1 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -342,10 +342,12 @@ export default { subscribe('text:image-node:delete', this.onDeleteImageNode) this.emit('update:loaded', true) useResizeObserver(this.$el, (entries) => { - const entry = entries[0] - const { width } = entry.contentRect - const maxWidth = width - 36 - this.$el.style.setProperty('--widget-full-width', `${maxWidth}px`) + window.requestAnimationFrame(() => { + const entry = entries[0] + const { width } = entry.contentRect + const maxWidth = width - 36 + this.$el.style.setProperty('--widget-full-width', `${maxWidth}px`) + }) }) subscribe('text:translate-modal:show', this.showTranslateModal) }, diff --git a/src/components/Editor/EditorOutline.vue b/src/components/Editor/EditorOutline.vue index ac91067228..d41e3739f1 100644 --- a/src/components/Editor/EditorOutline.vue +++ b/src/components/Editor/EditorOutline.vue @@ -16,17 +16,12 @@ diff --git a/src/components/Menu/MenuBar.vue b/src/components/Menu/MenuBar.vue index a6c3486f69..3417662dbd 100644 --- a/src/components/Menu/MenuBar.vue +++ b/src/components/Menu/MenuBar.vue @@ -197,17 +197,18 @@ export default { }, methods: { onResize(entries) { - const entry = entries[0] - const { width } = entry.contentRect + window.requestAnimationFrame(() => { + const entry = entries[0] + const { width } = entry.contentRect - // leave some buffer - this is necessary so the bar does not wrap during resizing - const spaceToFill = width - 4 - const spacePerSlot = this.$isMobile ? 44 : 46 - const slots = Math.floor(spaceToFill / spacePerSlot) + // leave some buffer - this is necessary so the bar does not wrap during resizing + const spaceToFill = width - 4 + const spacePerSlot = this.$isMobile ? 44 : 46 + const slots = Math.floor(spaceToFill / spacePerSlot) - // Leave one slot empty for the three dot menu - this.iconsLimit = slots - 1 - this.isReady = true + // Leave one slot empty for the three dot menu + this.iconsLimit = slots - 1 + }) }, showHelp() { this.displayHelp = true