New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-viewport] Add a meta viewport parameter to control ICB layout behavior for interactive overlays #7767
Comments
Yeah, sounds reasonable. I suppose the spec needs to clarify where to (visually) scroll in each mode. So for example, if a text input at the very bottom of the scrollport (or the visual viewport), then in the
Is there any workarounds for the breakages on sites where it's supposed to be working with the current Chrome/Firefox behaviors (i.e. resize-layout)? |
This seems like something that would happen as part of the focus steps which lead to the keyboard showing, or if the keyboard is shown via the virtual keyboard API then it should be included in the steps there. |
The work around if for those sites to add: |
What do we think of renaming |
What about I love the approach with the additional meta viewport parameter as it pretty much falls in line with previous usage of it. 👍🏻 One thing I'd like to throw into the discussion is the question if desktop viewport scrollbars should not also be consired dynamic UI and if we could lump them into into this spec, too? It happens quite often that they break my plans in regards to viewport related styling as documented here: #4691 (comment) (and it turned out that Finally, probably overreaching the scope of this topic: can we make available currently active dynamic UI dimensions via /fixed typos |
I think this term – along with What if we avoided this by not naming anything? We could use the key But then again, this behavior is only affected by the virtual keyboard, so why aim for a generic term over (*) Might need a better word for this …
Happy to hear!
That‘s outside of the scope of this issue, and is being discussed in #6026
The Virtual Keyboard API offers you some values for this, but only when |
This was merged in #7826, though I'm unclear on the process steps here (was there a resolution where this was adopted?) Should this issue be closed? |
On many devices, user agents have interactive overlay widgets to assist users when interacting with web pages. The most common is a virtual keyboard, which allows users on touch devices (mobile, tablet and touch-enabled laptops) to type input that is equivalent to that coming from a keyboard.
These interactive widgets typically overlap the web page's viewport, and hence there is a question of whether the viewport should resize to account for their presence.
Currently, most mobile browsers on Android (Chrome and Firefox in particular) resize the initial containing block (ICB) while the virtual keyboard is open. iOS browsers do not, and instead ovelay the virtual keyboard on top of the scrollable content of the web page without causing a change to layout. Chrome on ChromeOS has the same behavior as iOS. See here for many more details and a complete analysis of how it all works.
There are valid use cases for resizing the ICB (e.g. it provides a convenient way for mobile PWAs to keep informational/actionable bottom-bars or buttons visible on the screen while the virtual keyboard is open), and for not (in many cases, it's undesirable for UX or performance to not affect layout). Developers have also filed CSSWG (example) and browser bug issues (example) requesting both behaviors.
I propose we extend the viewport
<meta>
tag to opt into different behaviors. An example syntax would be:<meta name="viewport" content="width=device-width, initial-scale=1.0, virtual-keyboard=resize-layout">
(
resize-visual
andoverlays-content
would also be options; the former is iOS and ChromeOS, and the latter aligns with behavior of the virtual keyboard API).See here for more details.
We might want to pick a more general name than
virtual-keyboard
to be forward compatible with other interactive overlays that may be added in the future.I think
resize-visual
should be the default.The text was updated successfully, but these errors were encountered: