Codex/test ios keyboard liveview fix - #41
Merged
Merged
Conversation
Signed-off-by: kryptocodes <srivatsantb@gmail.com>
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.
Summary
Fixes the ~309px black band at the bottom of the LiveView viewer on iOS Safari once the user types the first character into a remote field. Three independent causes:
measure()was subtractingvisualViewport.offsetTopfrom the keyboard height.offsetTopis pan position, not occlusion, so a still-docked keyboard reportedoccludedBottom: 0and the viewer dropped its lift. Nowmax(layoutBaselineHeight, innerHeight) - vv.height, with a latched pre-keyboard baseline because Safari eventually shrinksinnerHeightonto the already-shrunk visual height. Same fix on the legacy parent-viewport path.position: fixed; height: 100%iframe follows Safari's shrinking layout viewport.pinFrameForKeyboard()pins the pre-keyboard box in CSS pixels (bottom: auto) for the keyboard session and cancels the viewport pan withtranslate3d(0, vv.offsetTop, 0). Opt out withpinKeyboardHeight: false.y = 24); Android keeps its under-finger placement.Validation
node --test kbd/test/*.test.mjs— 431 pass, 0 fail.kbd/test/host-measure-android.test.mjs(7 tests): layout-resize keyboard reports no occlusion in either update order; baseline relearns downward; VirtualKeyboard rect outranks the baseline; visual-only shrink still pins and reports; baseline survives the iOS mid-sessioninnerHeightcollapse.ios-proxy-placement,host-geometry,host-embed-layout,portal-blind-host,kbd-pan-reach.Risk and Rollback
height/bottom/top/transformon the embedder's iframe for the keyboard session, restored on dismiss.position: fixedonly.pinKeyboardHeight: falseor a non-fixed iframe, a frame that follows the layout shrink gets a full keyboard height of claimed occlusion. Needs the iOS ordering (visual viewport shrinks beforeinnerHeight). Locked down as "KNOWN GAP", not fixed.translate3dis inert there.HOST_ZERO_CONFIRM_MS). Blur, tap-away, andresetLayoutModestill reset immediately.git revert d833f50. Partial:pinKeyboardHeight: false.Checklist