[Webkit-unassigned] [Bug 254861] iPadOS: Viewport doesn't correctly restore after dismissing software keyboard for installed web apps

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 19 06:18:57 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=254861

philipp.pirrung+apple at softwarehelden.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |philipp.pirrung+apple at softw
                   |                            |arehelden.com

--- Comment #3 from philipp.pirrung+apple at softwarehelden.com ---
I can confirm that this issue exists on iPad Pro (11-inch) (3rd generation) with iPadOS 16.3.1.

Furthermore I was able to work around this behaviour with the following:
window.visualViewport.addEventListener("resize", () => {
    window.requestAnimationFrame(() => {
        if (window.visualViewport.height == document.documentElement.getBoundingClientRect().height) {
            document.documentElement.scrollTop = 0;
        }
    });
});

It seems that setting the scrollTop after the resize has finished, updates the visualViewport. Checking if the height of the visualViewport matches the height of the document ensures that the scrollTop is only "updated" when the full screen is available again (i.e. the keyboard has been dismissed).
While I'm in no way happy with this work-around, it seems to fix the originally described behaviour in all use-cases I've tested.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230419/e5cb577d/attachment-0001.htm>


More information about the webkit-unassigned mailing list