Bug 247410
| Summary: | iPadOS window.visualViewport.height incorrect when using external keyboard | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tyler Leonhardt <me> |
| Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | lplassman, olivier_thierie, thorton, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 16 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 16 | ||
Tyler Leonhardt
Steps to reproduce:
1. Have an iPad with a Magic Keyboard or other external keyboard so that the soft keyboard doesn't show up
2. Go to the repro (I stole from another issue): https://matan-hershberg-nuance.github.io/ios15-beta-visualviewport-bug/
3. tap in and out of the inputbox switching from showing the auto-complete and not
4. minimize the autocomplete too
Since the autocomplete UX is now "floating" instead of an entire bar across the screen, I expect that the visualViewport Height wouldn't change upon showing the autocomplete... but it does.
On my iPad Pro I can see the VisualViewport Height go from 727 when the input box isn't selected:
https://user-images.githubusercontent.com/2644648/199658322-ff1d64b6-09d6-497d-a7ee-abfd08980145.png
to 658 when the input box is selected:
https://user-images.githubusercontent.com/2644648/199658208-13cb1992-c5cc-4e3f-9aac-b4452e896b97.png
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Tyler Leonhardt
Related VS Code for the Web issue: https://github.com/microsoft/vscode/issues/149048
Radar WebKit Bug Importer
<rdar://problem/101933585>
Tyler Leonhardt
Coming back to this as we have heard complaints from more users. We considered using `body.clientHeight` as a workaround, but unfortunately, this does not update when a user triggers the _virtual_ keyboard.
...and that, has been a 12 year problem of detecting when a user opens the virtual problem sadly:
https://stackoverflow.com/questions/2593139/ipad-web-app-detect-virtual-keyboard-using-javascript-in-safari
hoping to wave and say a fix for this is very much wanted 🙏
Tyler Leonhardt
Just wanted to chime in and say this is still an issue and we continue to get issues opened on us for this behavior.
olivier_thierie
Hi, as the issue has been open for so long already, I hope a fix can be found / someone is looking into this :)
lplassman
Just chiming in to say that this issue still exists on iPad and would be great if this could be fixed. 🙏🏻