Skip to content

[Skia][WASM][iOS] No soft keyboard for a TextBox focused from code, nor when that TextBox is then tapped #25183

Open

Description

@mikernet

Current behavior 🐛

In a browser on iOS, a TextBox that takes focus from code outside of a user gesture, such as the first field of a dialog that opens, shows its caret but no soft keyboard. Tapping the TextBox does not bring the keyboard up either. It takes tapping another field and coming back, or tapping the TextBox a couple more times.

Seen on an iOS device with an application on a 6.8 build.

By default WebKit shows the input view for an element only when it was focused while the user was interacting with the page, when it takes over from an element already being assisted, or when a hardware keyboard is attached (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]). The hidden <input> is focused from code, so none of those holds. The tap then lands on the canvas: the TextBox has focus already, the hidden input is not focused again, and nothing tells WebKit that the user asked for the field.

It does not show in the iOS Simulator with the Mac's keyboard connected, which the hardware keyboard exemption would explain.

Expected behavior 🎯

Tapping the focused TextBox brings up the keyboard.

(The keyboard coming up along with the dialog, as in a native app, is a separate matter: iOS does not show it for a focus made once the tap is over.)

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

  1. A page with a Button that opens a ContentDialog holding a TextBox, which is focused from code when the dialog has loaded (Focus(FocusState.Programmatic)).
  2. Open the WebAssembly head in a browser on an iOS device and tap the button.
  3. The dialog opens with the caret in the TextBox and no keyboard.
  4. Tap the TextBox: still no keyboard.

Workaround 🛠️

Not focusing the TextBox from code on iOS, so that the first tap is what focuses it.

Affected platforms 📱💻🖥️

WebAssembly (Skia renderer), browsers on iOS

Uno.Sdk version (and other relevant versions) 📦

A 6.8 build (6.8.0-dev.212). The code involved is the same on master at efa2954.

IDE version 🧑‍💻

Not IDE related.

Anything else we need to know? 💬

This was first reported in #22258, for a ContentDialog that opens on a focused TextBox. This issue is about the half of it a page can do something about: the tap on the focused field.

A PR with a fix follows: the hidden input is focused again when its TextBox is tapped. WebKit treats focus() on the focused element as a refocus (Element::focus calls elementDidRefocus) and reports it to the UI process as long as no input view is showing for the element (WebPage::shouldDispatchUpdateAfterFocusingElement), this time as made while the user was interacting.

Activity

  1. added
    7.1
    on Oct 14, 2026
  2. removed
    7.1
    on Oct 29, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions