Repository navigation
web: don't read a desktop window resize as a keyboard inset - #1217
Open
MichaelBelousov wants to merge 1 commit into
Open
MichaelBelousov wants to merge 1 commit into
MichaelBelousov wants to merge 1 commit into
Conversation
keyboardInset() captured the canvas's rect on every focusin and only cleared it when a keyboard closed. On a desktop no keyboard ever opens, so the rect went permanently stale. A window that shrank after that read as a keyboard covering the space between rest.bottom and the smaller viewport: the app got a phantom inset to lay out above, and the canvas's CSS height got pinned to the focusin-time pixel height. The page could then resize around it forever without the editor noticing the new space, until a resize that grew the window back past the stale rect. Gate the inset on a device that actually has a soft keyboard: the primary pointer is coarse and never hovers (a phone or tablet). There the behavior is unchanged -- Android's resizes-content pages, the VirtualKeyboard API path and iOS's visual viewport all still satisfy it. One edge: a touch device with a mouse connected has a fine primary pointer, so it loses the inset optimization; its canvas then shrinks with the keyboard as resizes-content intends, and the app lays out in the smaller canvas, which is what the inset path exists to avoid. Found in an embedder (the graphl IDE in an electron window): focus the editor, shrink the window vertically, then resize the embedder's panel -- the editor stayed at the focusin-time height. Verified fixed there; the same page on a touch profile still gets insets.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
keyboardInset() captured the canvas's rect on every focusin and only cleared it when a keyboard closed. On a desktop no keyboard ever opens, so the rect went permanently stale. A window that shrank after that read as a keyboard covering the space between rest.bottom and the smaller viewport: the app got a phantom inset to lay out above, and the canvas's CSS height got pinned to the focusin-time pixel height. The page could then resize around it forever without the editor noticing the new space, until a resize that grew the window back past the stale rect.
Gate the inset on a device that actually has a soft keyboard: the primary pointer is coarse and never hovers (a phone or tablet). There the behavior is unchanged -- Android's resizes-content pages, the VirtualKeyboard API path and iOS's visual viewport all still satisfy it. One edge: a touch device with a mouse connected has a fine primary pointer, so it loses the inset optimization; its canvas then shrinks with the keyboard as resizes-content intends, and the app lays out in the smaller canvas, which is what the inset path exists to avoid.
Found in an embedder (the graphl IDE in an electron window): focus the editor, shrink the window vertically, then resize the embedder's panel -- the editor stayed at the focusin-time height. Verified fixed there; the same page on a touch profile still gets insets.
Part of #
In plain words
What changes
What you will notice
How we know it works
How this serves fizzy
For agents: technical summary
Goal
What changed and why
How it was verified
SDK impact
sdk/src/version.zig,sdk_versionuntouched, PR labelledsdksdk_version, lists thesdkPRs since the lastsdk-v*tagNot done / follow-ups