Repository navigation
fix(wasm): Keep the hidden TextBox input off-screen on iOS (backport #24527) - #24647
Merged
agneszitte merged 13 commits intoSep 25, 2026
Merged
Conversation
(cherry picked from commit 7b55382)
(cherry picked from commit 02b8706)
(cherry picked from commit 75fd518)
(cherry picked from commit 2411a6d)
(cherry picked from commit 0aee79a)
(cherry picked from commit c1fa3e9)
(cherry picked from commit 5207e3f)
(cherry picked from commit d9d6fcb)
(cherry picked from commit 8489da1)
(cherry picked from commit f91b4b8)
(cherry picked from commit 34c10e0)
(cherry picked from commit 275205c)
(cherry picked from commit f2cdde8)
4 of 5 tasks
ajpinedam
approved these changes
Sep 24, 2026
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24647/wasm-skia-net9/index.html |
Contributor
|
The build 235567 did not find any UI Test snapshots differences. |
Contributor
Author
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
This was referenced Nov 9, 2026
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.
GitHub Issue: closes #24526
PR Type:
🐞 Bugfix
What changed? 🚀
Current behavior. On the Skia WebAssembly head in iPad/iPhone Safari (and any iOS browser, all WebKit), focusing a
TextBoxthat sits near or under the soft keyboard can shift the whole application up: WebKit scrolls the page into the keyboard inset to reveal the focused editable. The page isposition:fixedso nothing else can move, and the shift is not undone until focus is lost. While the page is shifted,clientX/Y(viewport-relative in Safari) no longer match the canvas, so every tap landspanpixels away from what the user sees: tapping a secondTextBoxfocuses something else and closes the keyboard, and one-finger drags inside aScrollViewerpan the page instead of scrolling the content. The internalInputPanebring-into-view (#23890) and WebKit's reveal also fight each other, so the focused field bobs in and out from under the keyboard.WebKit has two reveal paths (from
WKWebViewIOS.mm/WKContentViewInteraction.mm):_zoomToRevealFocusedElement(deferred to keyboard-will-show; centers the element when it is within 50pt of the keyboard) — this one honorsfocus({ preventScroll: true });_scrollToAndRevealSelectionIfNeededscrolls by exactlycaretBottom + 4 − visibleHeightwhen the caret was visible before the change — this one ignorespreventScroll.Both need an on-screen caret rect to act on. Uno's
TextBoxdraws its own caret, selection, touch grippers and selection flyout, so the shared invisible#uno-inputonly has to exist and be focused; its position on iOS is not used for anything the user can see.New behavior.
navigator.platformiP*, orMacIntelwithmaxTouchPoints > 1for iPadOS 13+),#uno-inputis created withtop: -10000px(left stays 0 so a right-to-left document gains no scrollable overflow) andupdatePosition/updateSizebecome no-ops there: a multi-lineTextBoxreports its full content height, which would otherwise stretch the input back into the viewport. WebKit finds nothing to reveal, the visual viewport never pans, and pointer coordinates stay aligned with the canvas. Other platforms keep the input placed and sized over theTextBox(desktop IME candidate windows anchor to it). The active policy is exposed asdata-uno-placement="offscreen|tracking"on the input for Web Inspector diagnosis.focus()is called with{ preventScroll: true }on both the retarget and the swap paths, on every platform: theInputPanedrives bring-into-view, the browser's scroll-to-focus is never wanted.SoftKeyboardFocusTestsmanual sample gains a side-panelScrollViewer(Title, numeric AutoNumber, dates, multiline notes, ten fields) with a focused-field/panel-offset readout, mirroring the customer layout. Items 4–5 also reproduce in the iOS Simulator (toggle I/O > Keyboard > Connect Hardware Keyboard to force a keyboard frame change).Given_TextBox.When_Focused_In_Browser_Then_Hidden_Input_Placement_Matches_Hostpins the placement policy on whichever browser hosts the suite. It derives the expected policy from the host rather than from what the page reports, then asserts the matching geometry:trackingmeans the input's rendered rect sits inside theTextBoxand follows it when it moves;offscreenmeans the rect stays entirely above the viewport across the same move. A missing input fails both branches.Validation.
SamplesAppserved over LAN, driven from the session. The pan was reproduced deterministically on the baseline by parking the input under the keyboard and changing the keyboard frame (Simulator hardware-keyboard toggle): page scrolls 125px,vv.offsetTop == scrollY == 125, a tap at the checkbox's visual position reportsclientY=123/pageY=498and toggles a control 375px away.preventScrollalone still pans 125px;scrollTo(0,0)counter-pan leaves a 3–8px visual-viewport offset JS cannot clear;line-height:0is ignored on<input>;width/height:0still pans (caret rect is not clipped);font-size:0works but risks the 16/fontSize focus zoom on iPhone; off-screen input: no pan, keyboard opens, typing works.visualViewport.offsetTopstays 0), typing reaches theTextBox, tapping a neighbouringTextBoxkeeps the keyboard open, dragging inside aScrollViewerscrolls it. Control run with the input forced back on-screen still pans.Given_TextBox.When_Focused_In_Browser_Then_Hidden_Input_Placement_Matches_Hostpasses on the Skia WASM head in headless Chrome, which exercises thetrackingbranch. Theoffscreenbranch runs the first time the suite is hosted on an iOS browser.PR Checklist ✅
Screenshots Compare Test Runresults — the reported differences (skia-linux 57, skia-windows 2310, wasm 11) are identical on perf(uno-ui): Reuse boxes on the inherited-property and hit-test paths #24525, perf(theming): Walk resource dictionaries without an iterator #24523, perf(uno-ui): Index DO collections in tree walks #24519 and fix: Refresh NavigationView ancestor selection #24509, so the baseline shifted on master. This change is browser-only TypeScript and its sample isIsManualTest/IgnoreInSnapshotTests, so it emits no snapshots.This is an automatic backport of pull request #24527 done by [Mergify](https://mergify.com).