Skip to content

[WASM Skia] iOS Safari pans the app to reveal the hidden TextBox input, breaking hit-testing and ScrollViewer drags #24526

Closed

Description

@ajpinedam

Current behavior 🐛

On the Skia WebAssembly head in iPad/iPhone Safari (and any iOS browser, since they all embed WebKit), focusing a TextBox that sits near the soft keyboard shifts the entire application up into the keyboard area. The page stays shifted until focus is lost, and while it is shifted every tap lands away from what the user sees: tapping a second TextBox focuses something else and closes the keyboard, and one-finger drags inside a ScrollViewer pan the page instead of scrolling the content. The InputPane bring-into-view and the browser's own reveal also fight each other, so the focused field bobs in and out from under the keyboard.

It reproduces most easily with several TextBoxes inside a constrained ScrollViewer (a side panel or a form), tapping one after another.

Expected behavior 🎯

The application never moves for the soft keyboard. The InputPane occlusion scrolls the focused TextBox above the keyboard inside its ScrollViewer, as on WinUI; taps keep landing where they are drawn; the keyboard stays open when moving between fields; and dragging inside a ScrollViewer scrolls that ScrollViewer.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Run SamplesApp for net10.0-browserwasm and open it in Safari on an iPad (the iOS Simulator also works, see step 4).
  2. Open the sample TextBox > TextBox_Multiple_Focus_Keyboard.
  3. Tap a TextBox in the lower half of the screen, so the keyboard covers it.
  4. With the keyboard up, cause a keyboard frame change. On a device this happens on its own during the two-step keyboard show or when the predictive bar appears; in the Simulator, toggle I/O > Keyboard > Connect Hardware Keyboard on and then off.
  5. The whole page shifts up (visualViewport.offsetTop and window.scrollY become non-zero). Tapping another TextBox now delivers the tap to a different control and closes the keyboard; dragging inside the ScrollViewer pans the page instead of scrolling it.

Workaround 🛠️

None from application code. The shift is WebKit revealing the focused DOM <input> that Uno uses for text entry, and touch-action does not prevent it.

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

WebAssembly

Uno.Sdk version (and other relevant versions) 📦

Reproduced on current master and on 6.7; iPadOS 18.6 and 26.0 (Safari).

IDE version 🧑‍💻

n/a (browser behavior)

Anything else we need to know? 💬

Root cause, from the WebKit sources:

  • WKWebViewIOS.mm _keyboardChangedWithInfo calls _scrollToAndRevealSelectionIfNeeded on every keyboard frame change when the focused element's caret was visible beforehand. Uno's page is position: fixed, so that scroll lands in the keyboard inset and pans the whole canvas. This path ignores focus({ preventScroll: true }).
  • The initial-focus path, WKContentViewInteraction.mm _zoomToRevealFocusedElement, does honor preventScroll.

Both act on the on-screen rect of the focused editable. Uno does not need that rect on iOS, because the TextBox draws its own caret, selection and grippers.

Taps misfire while the page is shifted because Safari reports clientX/Y relative to the visual viewport while the canvas is drawn at layout coordinates, so hit-testing is off by exactly the shift.

This is a follow-up to #23890, which fixed the earlier iPad soft-keyboard focus problems (self-dismissing keyboard, missing LostFocus, no bring-into-view).

Activity

  1. added
    triage/untriaged
    on Sep 16, 2026
  2. Jen-Uno commented on Sep 30, 2026

    @Jen-Uno
    Contributor

    QA: closing out without a manual pass. The fix in #24527 ships with automated tests (SoftKeyboardFocusTests.xaml, SoftKeyboardFocusTests.xaml.cs, Given_TextBox.skia.cs) that exercise the change.

    If you still see this behaviour on a build that includes that PR, please reopen or comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions