Re: [csswg-drafts] [css-position-3] Reinterpret viewport positioned (fixed, sticky) elements wrt virtual keyboard (#7475)

I’ve given all proposals in here a lot of thought and while I do like the general idea behind Option 5 _([PosFixedViewport](https://flackr.github.io/web-demos/viewport/#behavior=fixed-viewport))_. But, I have a few concerns to be fully convinced of it:

1. This would alter the existing behavior of `position: fixed` on all iOS browsers + Chrome on CrOS. [This demo here](https://cdpn.io/pen/debug/eYMZEaV/addc16387bdd13083e05948afcbb8d63) – which mimics a bottom navigation bar – for example would no longer work as the author expected it to work. This will annoy authors.
1. Authors cannot easily feature detect wether the new or old behavior is being used. Therefore they cannot predict how the site will look with the OSK shown. This will annoy authors as well.
1. This does not provide a solution for authors to stick something against the Visual Viewport, something that might come in handy for Floating Action Buttons or Toolbars which do need to stay above the zoomed content.

Could we solve this differently? Instead of overloading the position property with new values – such as `device-fixed`, `visual-viewport-fixed`, … – could we extend its syntax and provide the viewport as an extra argument? I’m thinking of:

- `position: fixed / layout` = current behavior, would be the same as `position: fixed`)
- `position: fixed / visual` = fixed against the visual viewport, also when zoomed in
- `position: fixed / fixed` _(* lacking a better name)_ = the proposed behavior from Option 5 _([PosFixedViewport](https://flackr.github.io/web-demos/viewport/#behavior=fixed-viewport))_

This way:

1. The behavior of `position: fixed` would not be changed, making the adjustments backwards compatible
2. Authors can feature detect the new behavior and act upon that
3. Authors can also stick something against the Visual Viewport

Either way, I think we should definitely adjust Chrome on Android to no longer resize the ICB when the OSK gets shown. This can be implemented separately from the outcome here.

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


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

Received on Wednesday, 13 July 2022 09:22:41 UTC