Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion resources/js/components/ui/LivePreview/LivePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ function setEditorWidth(width) {
localStorage.setItem(widthLocalStorageKey, width);
}

function onResizeEnd() {
editorResizing.value = false;

// Chromium doesn't recalculate iframe scroll state after the parent
// container is resized. Toggling a transform forces a reflow. #14540
const iframe = iframeContentContainer.value?.querySelector('iframe');
if (iframe) {
iframe.style.transform = 'translateZ(0)';
requestAnimationFrame(() => iframe.style.transform = '');
}
}

function close() {
if (poppedOut.value) closePopout();

Expand Down Expand Up @@ -343,7 +355,7 @@ Statamic.$events.$on(`live-preview.${name.value}.refresh`, () => {
v-show="!poppedOut"
@resized="setEditorWidth"
@resize-start="editorResizing = true"
@resize-end="editorResizing = false"
@resize-end="onResizeEnd"
@collapsed="collapseEditor"
/>
</div>
Expand Down
Loading