Re: [csswg-drafts] [css-values-4] Visual viewport units (#7194)

> This behavior is problematic when trying to build interfaces that are positioned above the on-screen keyboard, or resize so that they are always visible while the keyboard is open. Examples include chat UIs, commenting UIs, trays/sheets, modals containing forms, floating toolbars, etc.

A challenge with using a visual viewport unit to achieve these use cases is that the visual viewport also resizes (and offsets) as a result of pinch-zoom. If you're positioning a floating toolbar based just on the visual viewport height, it'll be wrong as soon as some pinch-zoom (and non-0 `visualViewport.offsetTop`) is introduced (and browsers perform automatic zoom onto a focused input element in some cases).

IMHO, something like [position: device-fixed](https://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html#:~:text=the%20user%20interaction.-,position%3A%20device%2Dfixed,-Which%20of%20these) seems more natural for these use cases since it'd let you position things in the coordinate space of the visual viewport.

-- 
GitHub Notification of comment by bokand
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7194#issuecomment-1157148321 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 16 June 2022 02:00:53 UTC