Repository navigation
feat(textbox): Honor PreventKeyboardDisplayOnProgrammaticFocus - #25995
MartinZikmund merged 3 commits into
Conversation
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 243404 found UI Test snapshots differences: Details
|
Xiaoy312
left a comment
There was a problem hiding this comment.
LGTM: it reuses RichEditBox's suppression path, and the Android red is the known order-dependent Given_TextBox ScrollViewer trio, unrelated to this PR. A few non-blocking notes inline. The iOS one is the only one I'd want a follow-up for.
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244024 found UI Test snapshots differences: Details
|
33a00c2 to
3e6e042
Compare
TextBox and PasswordBox declared it as a NotImplemented stub, so a programmatic focus always opened the software keyboard. It now keeps the keyboard hidden, as in WinUI, until the user taps the box. The focus origin comes from the focus manager: FocusState is coerced to the last input device. The InputPane tests simulate the keyboard through OccludedRect, and on the Android emulator the real keyboard their programmatic focus opened reported its own occlusion over the simulated one. They now keep it hidden. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The tap that opens a keyboard a programmatic focus kept hidden set a flag that stayed until the box lost focus, so every later text input restart on the same focus, a programmatic one included, was taken for a tap. The tap now travels with its own request instead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
On iOS a suppressed keyboard now swaps in an empty InputView instead of skipping the first responder, so hardware keyboards still type. The view gets the focus origin, and a tap on an already-focused box re-shows the keyboard from OnTapped (as WinUI does), so a drag-select doesn't. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244079 found UI Test snapshots differences: Details
|
Linux snapshot runs began segfaulting on exit once #25995 added this diagnostic sample: 24 of 44 runs since, 0 of 64 before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1pmTF7nEsciGTG9rw
GitHub Issue: part of #9080 (flaky tests roundup), related to #25227
PR Type:
✨ Feature
What changed? 🚀
TextBox.PreventKeyboardDisplayOnProgrammaticFocusandPasswordBox.PreventKeyboardDisplayOnProgrammaticFocuswere generated[NotImplemented]stubs, so a programmatic focus always opened the software keyboard. They now work as in WinUI: with the property set,Focus(FocusState.Programmatic)keeps the keyboard hidden until the user taps the box.RichEditBoxalready honored it.TextBoxCoredecides whether to suppress the keyboard when platform text input starts, and passes that to the text box view (iOS, WASM), to the IME session activation, and to the Android focus notification, which no longer callsShowTextInputwhile suppressed.FocusStateitself is coerced to the last input device, so a programmatic focus reads asPointerafter any pointer input.Why now:
Given_InputPaneflakiness on AndroidThe
Given_InputPanetests simulate a keyboard by settingInputPane.OccludedRect, then focus their fields programmatically. On the Android emulator, that focus also opened the real soft keyboard, andApplicationActivity.OnKeyboardChangedwrote its insets into the sameOccludedRectwhenever it showed or hid, overriding the simulated value. In the last 150 CI builds this failedWhen_Focus_Moves_While_Occluded_Then_New_Field_Brought_Above_Occlusionin 18 builds andWhen_OccludedRect_Cleared_Then_Content_Restoredin 5, plus other tests of the class less often, also on the 6.7 and 6.8 branches:CI device logs show the real keyboard showing (
InsetsController: show(ime()),ImeTracker ... onShown) during those tests. The tests now setPreventKeyboardDisplayOnProgrammaticFocuson their fields. #25227's two skipped tests may have the same cause (its iOS gap is about a keyboard height); they are not re-enabled here.Validation
New runtime tests
Given_TextBox_PreventKeyboardDisplay: default value; the IME activation is suppressed only for a programmatic focus with the property set (Programmatic/Pointer/Keyboard, on and off);PasswordBox; a real injected tap on a programmatically focused box opens the keyboard (desktop only: the injected touch doesn't reach the TextBox on the Android emulator).Skia desktop (Windows):
Given_TextBox_PreventKeyboardDisplay,Given_TextBox,Given_PasswordBox,Given_RichEditBox,Given_ImeSessionCoordinator_RootOwnership,Given_InputPane: 1413 passed, 0 failed.Android emulator (API 34):
Given_InputPaneand the new tests, 5 iterations each with no retries: all pass (one already skipped on Android). Real keyboard activity during theGiven_InputPanerun, from logcat:The failure itself did not reproduce on the local emulator (master's
Given_InputPanealso passes 5 iterations there, AOSP keyboard vs CI's Gboard on API 36), so the CI Android lanes are the real check of the flakiness.Uno.UIandUno.UI.Runtime.Androidbuild with analyzers.Not verified: the tap-to-open path on Android (no working touch injection on the TextBox there), and iOS.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code