fix(web): keep browser pages aligned during panel animations (#12329)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-17 16:29:20 -07:00
1 parent e26af33b22
commit 4cc984fedc
1 file changed
+4
@@ -64,6 +64,10 @@ export function BrowserSurfaceSlot(props: {
update();
const observer = new ResizeObserver(update);
observer.observe(element);
// Inline panels animate their outer width while keeping the content at
// full width. The slot moves without resizing, so measure on shell resizes too.
const panel = element.closest('[data-preview-panel-mode="inline"]');
if (panel) observer.observe(panel);
window.addEventListener("resize", update);
window.addEventListener("scroll", update, true);
return () => {