Stop page scrolling

Sometimes an input we are focusing on is considered out of the viewport
by the browser. This is not always the case, and, even when it is, it's
not trivial to move it back in.

Instead, this change detects scrolling and re-scrolls the view to 0, 0.

Doing so is not without consequence, as there is a slight jitter before
we can scroll back, however this is substantially better than having the
controls off-the-page.

Signed-off-by: Skyler <skyler.grey@collabora.com>
Change-Id: Ie5003f9244ce1c0e8a183de5fdbcf3a880b13a13
pull/9004/head
Skyler 2024-05-07 14:41:36 +00:00 committed by Szymon Kłos
parent fcfb95638f
commit 3dd2087bae
1 changed files with 1 additions and 0 deletions

View File

@ -1285,6 +1285,7 @@ window.app = {
function handleViewportChange(event) {
var visualViewport = event.target;
window.scroll(0, 0);
document.body.style.height = visualViewport.height + 'px';
}