Skip to content

fix: prevent custom-panel iframe from shifting the page off-screen#17361

Open
hristoterezov wants to merge 2 commits intomasterfrom
fix/iframe-scroll-into-view-shifts-page
Open

fix: prevent custom-panel iframe from shifting the page off-screen#17361
hristoterezov wants to merge 2 commits intomasterfrom
fix/iframe-scroll-into-view-shifts-page

Conversation

@hristoterezov
Copy link
Copy Markdown
Member

Summary

Two independent fixes that came out of debugging an intermittent layout glitch where the videoconference would shift up by ~96px after sending a message in the custom-panel iframe (and oscillate with toolbar visibility from then on).

fix(base): prevent body from being scrolled by cross-frame scrollIntoView

Root cause: the custom-panel iframe's chat auto-scrolls on new content via scrollIntoView({ behavior: 'smooth' }). Per the CSSOM View spec, the algorithm walks up the frame tree and re-runs against the iframe element in the parent document. With body { overflow: hidden }, body is still a scroll container and the engine slides it up by exactly body.scrollHeight - clientHeight, which equals the off-screen toolbar's height (~96px because the hidden toolbar is parked at bottom: -2 * toolbarSize).

overflow: clip (CSS3) makes the element not a scroll container at all, so cross-frame scrollIntoView propagation has nowhere to land in the parent. overflow: hidden is kept as a fallback declaration for Chrome <90 and Safari <16.

fix(custom-panel): refresh videoSpaceWidth when the panel toggles open/closed

Independent issue spotted in the same area: the custom-panel feature was missing the isOpen subscriber that chat and the participants pane have (react/features/filmstrip/subscriber.web.ts:103-121). Toggling the panel did not refresh videoSpaceWidth, so tile-view dimensions stayed sized for the previous layout until something else triggered a recalculation.

Test plan

  • Open custom panel, choose an agent, type a message, hit enter, move mouse — page no longer shifts up; toolbar shows/hides at the correct position.
  • Verify document.body.scrollTop remains 0 throughout.
  • Toggle custom panel open/closed multiple times — tile dimensions correctly account for the panel's width without needing an unrelated event to trigger recalculation.
  • Smoke test on Safari 16+ (uses clip) and Safari 15 (falls back to hidden).

…View

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).
…n/closed

Without this subscriber, opening or closing the custom panel does not refresh
`videoSpaceWidth` in redux, so tile-view dimensions stay sized for the previous
layout until something else (window resize, chat toggle, panel drag) triggers a
recalculation. Mirrors the equivalent subscribers for chat and the participants
pane in `react/features/filmstrip/subscriber.web.ts`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant