REOPENED202120
CSS position: sticky does not pin element to bottom of screen when virtual keyboard is open
https://bugs.webkit.org/show_bug.cgi?id=202120
Summary CSS position: sticky does not pin element to bottom of screen when virtual ke...
william
Reported 2019-09-23 15:49:05 PDT
CSS position: sticky/-webkit-sticky does not pin element to bottom of screen when virtual keyboard is open. Steps to reproduce: 1. Open https://codepen.io/wmsmacdonald/pen/vYBVVRL in Safari on iOS 2. Scroll to bring white screen into viewport 3. Click text input to focus Expected: Red footer should stick to bottom of screen even when virtual keyboard is open Actual: User must scroll down with keyboard open in order to see the red footer
Attachments
Radar WebKit Bug Importer
Comment 1 2019-09-26 19:53:57 PDT
Simon Fraser (smfr)
Comment 2 2019-10-02 13:36:06 PDT
Sticky position elements use the layout viewport (not the visual viewport) for positioning, and when the keyboard is up, the layout viewport extends below the keyboard. So this behavior is expected. position:fixed elements have the same behavior.
william
Comment 3 2019-10-03 13:07:41 PDT
I confirmed that position: sticky uses the visual viewport for non-Safari Webkit browsers: Chrome Firefox Opera Samsung Internet Based on this, I would expect the onus to fall on the Safari team to show that they have the correct interpretation of the the CSS spec. I wasn't able to find to find anything specific regarding layout vs visual viewport in the spec: https://www.w3.org/TR/css-position-3/#sticky-pos But maybe you have reference that is guiding your interpretation. I made a StackOverflow question to give this some visibility: https://stackoverflow.com/questions/58226087/position-sticky-doesnt-work-when-virtual-keyboard-is-open-in-safari/58226155#58226155
william
Comment 4 2019-10-03 13:48:14 PDT
By the way, thank you for supporting this software. One more thing: is there a workaround for fixing an element to the visual viewport that has good Safari support? The Visual Viewport API gives you enough information to calculate this https://developer.mozilla.org/en-US/docs/Web/API/Visual_Viewport_API but it only is supported by Safari 13.
Note You need to log in before you can comment on or make changes to this bug.