Skip to content

Commit 2ff82be

Browse files
committed
fix(base): prevent body from being scrolled by cross-frame scrollIntoView
Chrome's smooth cross-frame scrollIntoView walks up through frame boundaries and lands on the parent's nearest scroll container. With `overflow: hidden`, body is still treated as a scroll container that can be programmatically scrolled, so when iframe content (e.g. the custom panel chat) auto-scrolls on new content, the engine slides the entire body up by the off-screen toolbar's height. Switching to `overflow: clip` removes body from the scroll container chain entirely so the propagation has nowhere to land. `overflow: hidden` is kept as a fallback for browsers that do not understand `clip` (Chrome <90, Safari <16).
1 parent 9e7c09c commit 2ff82be

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

css/_base.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ html {
2222
height: 100%;
2323
width: 100%;
2424
overflow: hidden;
25+
overflow: clip;
2526
}
2627

2728
body {
@@ -30,7 +31,14 @@ body {
3031
height: 100%;
3132
font-size: 0.75rem;
3233
font-weight: 400;
34+
// `clip` (vs. `hidden`) makes the element a non-scroll container so the
35+
// engine cannot programmatically scroll it. Prevents Chrome's smooth
36+
// cross-frame `scrollIntoView` from sliding `body` up by the off-screen
37+
// toolbar's height when content inside an iframe (e.g. the custom panel)
38+
// requests an auto-scroll. The `hidden` line is the fallback for browsers
39+
// that do not understand `clip` (Chrome <90, Safari <16).
3340
overflow: hidden;
41+
overflow: clip;
3442
color: #F1F1F1;
3543
background: #040404; // should match DEFAULT_BACKGROUND from interface_config
3644
}

0 commit comments

Comments
 (0)