fix(mobile): update resized frame ID

When resizing the frame on mobile we correctly resize the outer <div>
element. We used to also resize the frame, but in ba45233bf (chore:
refactor iframes to load collabora directly, 2023-06-11) the ID of the
iframe was changed without things that depended on it also changing.

In Chrome, this causes the issue that the iframe isn't resized all the
way down, leading to it being possible to scroll the iframe inside the
viewport. This is bad as it means some elements of Collabora Online that
are meant to be stuck to different parts of the screen can go off the
screen edge.

There are some bits of CSS which also refer to this ID. To aid in easy
partial reverting (and as I don't currently have a need for them) I have
not fixed them in this commit

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
This commit is contained in:
Skyler Grey 2025-11-05 12:07:00 +00:00
parent 7aa9de4f2f
commit 3864969204

View file

@ -17,8 +17,8 @@ const handleScrollReset = () => {
// see https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport
const handleResize = () => {
const expectedHeight = window.visualViewport.height ?? document.documentElement.clientHeight
const frame = document.getElementById('richdocumentsframe')
if (frame) {
const frames = document.getElementsByClassName('office-viewer__iframe')
for (const frame of frames) {
frame.style.maxHeight = expectedHeight + 'px'
}
const viewer = document.querySelector('.office-viewer')