Repository navigation
fix(a11y): Stop TextBox focus bouncing with WASM accessibility on - #26241
morning4coffe-dev wants to merge 8 commits into
Conversation
|
Claude finished @morning4coffe-dev's task in 19s —— View job Review summaryVerdict: looks good, with minor follow-ups. This is a root-cause fix. It removes the competing focus of the hidden input and the semantic node, and it ignores the echo, rather than adding a guard. The runtime tests cover the scenarios in the description (programmatic, keyboard and pointer focus, PasswordBox, and a browser-initiated focus on the semantic input). Issues: 0 high, 1 medium, 1 low (inline).
Cross-cutting notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
Claude finished @morning4coffe-dev's task in 12s —— View job Review summaryVerdict: looks good. Since the previous review, the echo path in Issues: 0 high, 0 medium, 1 low (still open).
Notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244702 found UI Test snapshots differences: Details
|
479416b to
a16d8cc
Compare
|
Claude finished @morning4coffe-dev's task in 11s —— View job Review summaryVerdict: looks good. I found nothing new to block on. Issues: 0 high, 0 medium, 0 low.
Notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 244955 found UI Test snapshots differences: Details
|
|
Claude finished @morning4coffe-dev's task in 12s —— View job Review summaryVerdict: looks good. I found nothing new to block on. The new commits since the last review are test-only ( Issues: 0 high, 0 medium, 0 low.
Notes
|
|
The build 245166 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
MartinZikmund
left a comment
There was a problem hiding this comment.
@morning4coffe-dev The fix looks right to me. It removes the actual cause (two inputs fighting over DOM focus) instead of muting OnNativeBlur, and dropping the echo matches WinUI: CFocusManager::UpdateFocus (dxaml/xcp/core/dll/focusmgr.cpp, the pNewFocus == m_pFocusedElement branch) re-raises GotFocus and rewrites FocusState when Focus() hits the already-focused element with a different state. So an echo that isn't a real focus request has to stop before Focus(). I also checked that FocusManager.mux.cs assigns _focusedElement before UpdateFocusState -> StartEntry, so the synchronous echo from semanticElement.focus() is detected correctly.
One thing before I approve:
- The TextBox/PasswordBox tests most likely can't fail on CI (details inline). Please add an assertion that doesn't depend on browser focus events.
Optional nit inline on the echo check.
Chrome holds focus and blur events back while its window lacks OS focus, as on the CI agents, so the GotFocus log alone could pass without the fix. Assert the shared hidden input is never attached, which the bouncing path does regardless of event delivery.
An element without a semantic node of its own mirrors its focus onto its nearest semantic ancestor. A deferred browser focus event for that ancestor was re-applied as Keyboard focus on the ancestor, pulling XAML focus off the element.
|
Claude finished @morning4coffe-dev's task in 18s —— View job Review summaryVerdict: looks good. I found nothing new to block on. Issues: 0 high, 0 medium, 0 low.
Notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248150 found UI Test snapshots differences: Details
|
…textbox-focus # Conflicts: # src/Uno.UI.Runtime.WebAssembly.Browser/Accessibility/FocusSynchronizer.cs
|
Claude finished @morning4coffe-dev's task in 17s —— View job Review summaryVerdict: looks good. I found nothing new to block on. Issues: 0 high, 0 medium, 0 low.
Notes
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248213 found UI Test snapshots differences: Details
|
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
GitHub Issue: closes #24866
PR Type:
🐞 Bugfix
What changed? 🚀
With WASM accessibility enabled, focusing a
TextBoxraisedGotFocus,LostFocus, thenGotFocusagain. Two inputs were fighting over browser focus:StartEntryfocused the hidden native<input>used for typing.OnNativeBlur→Unfocus).Focus(Keyboard), which also overwrote the originalFocusState.Changes:
BrowserInvisibleTextBoxViewExtension.tsfocus(): when the control has a semantic node, that node is focused directly (with the blur handler suppressed) and the hidden input isn't used. The semantic input is already a real, editable<input>, so this leaves one element holding browser focus.FocusSynchronizer.OnBrowserFocus: a browser focus on the semantic node of the element that already has XAML focus is an echo and is ignored, soFocusStateis no longer overwritten withKeyboard.Tests:
Given_WasmAccessibleTextBoxFocuschecks a TextBox focused programmatically, by keyboard and by pointer, plus a PasswordBox and a browser-initiated focus on the semantic input. Each gets exactly oneGotFocus, noLostFocus, and the rightFocusState.Also checked by hand with real Tab, a mouse click and a screen-reader style
.focus(): one GotFocus each, and typed text arrives. I didn't test on a real mobile device or with an IME. Master changed the same TS file recently for the soft keyboard and IME fixes; this rebases cleanly onto them, but a quick check on a phone would be good.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code