w3c / virtual-keyboard

VirtualKeyboard API
https://w3c.github.io/virtual-keyboard/
Other
16 stars 3 forks source link

Default value of overlaysContent #8

Closed lpd-au closed 2 years ago

lpd-au commented 2 years ago

The spec currently describes overlaysContent as "A boolean, initially false." It is my understanding that Chrome/Firefox and Safari currently have diverging behaviour on whether the on-screen keyboard overlays the visual viewport, and changing this behaviour would involve a significant web compatibility risk. Unless Safari has expressed an intent to take on this risk and change their default behaviour to match Chrome and Firefox, for backwards compatibility reasons I propose the spec should permit user-agents to define an initial value of true.

snianu commented 2 years ago

@lpd-au There is no change in the behavior if overlaysContent is not set to true. It will just follow the existing logic for scrolling editable element into view when keyboard shows up, resizing visual or layout viewports etc. If you notice any changes please file a bug in the corresponding Browser's bug repo.

lpd-au commented 2 years ago

@snianu isn't that rather confusing design/nomenclature, if setting overlaysContent to false still allows the virtual keyboard to overlay content on Safari/iOS as per existing logic?

snianu commented 2 years ago

So, the goal here is to not resize both layout & visual viewports when overlaysContent is set to true. Safari does resize the visual viewport, but the layout viewport is unchanged. See this post for more context & test page that you can use to test this scenario.