Bug 259902 - visualViewport.height returns incorrect value after closing virtual keyboard and rotating screen in web app mode
Summary: visualViewport.height returns incorrect value after closing virtual keyboard ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-08-07 14:56 PDT by Yuwei
Modified: 2023-10-04 02:48 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuwei 2023-08-07 14:56:09 PDT
Repro:

1. Visit https://ywh233.github.io/ on mobile Safari
2. Add site to home screen
3. Open the added web app
4. Click `iOS rotation repro` from the link
5. Rotate to landscape mode
6. Tap the textarea
7. Tap `Done` on the virtual keyboard to close it
8. Rotate to portrait mode

Expected:

The shown visual viewport size should be 390x797, i.e. matching the size of the layout viewport

Actual:

The shown visual viewport size is 390x343, which is smaller than the layout viewport. The virtual keyboard isn't open, so this is an unexpected value.

---

This seems to be only reproducible in web app mode. I was not able to repro it on mobile Safari. Also I had to open and close the virtual keyboard to trigger the bug. Simply rotating the screen back-and-forth didn't trigger it.

Source code for repro: https://github.com/ywh233/ywh233.github.io/blob/main/ios_rotation_repro.html
Comment 1 Radar WebKit Bug Importer 2023-08-07 15:07:54 PDT
<rdar://problem/113524249>