mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-17 21:12:14 +01:00
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:
parent
7aa9de4f2f
commit
3864969204
1 changed files with 2 additions and 2 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue