Repository navigation
fix(a11y): Expose SplitButton as primary and menu buttons - #25888
Conversation
|
Claude finished @morning4coffe-dev's task in 21s —— View job PR review: SplitButton a11y on WASMVerdict: fix-first (minor) The approach is sound. A Issues: 0 high, 2 medium (posted inline). Both concern state updates after creation: label refresh and focusability on re-enable. Cross-cutting notes:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved SplitButton accessibility defects cause incorrect keyboard activation and tab order, stale button labels, and touch-exploration bounds that no longer match the control after resizing.
6 open issues
Part labels do not update when content changes · New Roving tabindex adds an unintended SplitButton tab stop · New SplitButton part bounds become stale after resizing · New Tab navigation cannot move between SplitButton parts · New Native Space activation is suppressed for the menu button · New Re-enabling ignores the requested SplitButton focusability · New
What changed in this PR
This PR gives WebAssembly split buttons separate accessible primary and menu actions, while preserving the existing automation patterns and Raw template parts.
Changes:
- Adds a split-button semantic type rendered as a group containing two buttons.
- Routes focus, enabled state, expansion, and toggle state to the synthesized buttons.
- Adds runtime tests for labels, menu activation, primary invocation, and toggle state.
| File | Description |
|---|---|
src/Uno.UI/UI/Xaml/Controls/SplitButton/SplitButton.cs |
Exposes template parts internally for accessibility metadata. |
src/Uno.UI/Accessibility/AriaMapper.cs |
Adds the split-button semantic type and mapping. |
src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Automation/Given_AccessibleSplitButton.cs |
Tests split-button and toggle-split-button semantics. |
src/Uno.UI.Runtime.WebAssembly.Browser/ts/Runtime/SemanticElements.ts |
Creates the group and buttons and routes activation and state. |
src/Uno.UI.Runtime.WebAssembly.Browser/ts/Runtime/Accessibility.ts |
Adds delegated focus and part-specific focusability and pressed-state updates. |
src/Uno.UI.Runtime.WebAssembly.Browser/Accessibility/WebAssemblyAccessibility.cs |
Routes split-button toggle changes to aria-pressed. |
src/Uno.UI.Runtime.WebAssembly.Browser/Accessibility/SemanticElementFactory.cs |
Supplies group and part metadata through browser interop. |
Review effort: Balanced
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242655 found UI Test snapshots differences: Details
|
|
|
|
Claude finished @morning4coffe-dev's task in 20s —— View job Review: SplitButton a11y on WASM (re-review of
|
There was a problem hiding this comment.
🟡 Changes recommended
The review found an issue that should be addressed before approval.
4 open issues
The split-button peer's disabled state is not necessarily the primary button's state. The default… · New On the dynamicOnChildAddedpath, accessibility can create this node before the new SplitButton… · New These new active-element IDs are not understood by the existing modal focus trap.… · New Stopping Enter/Space propagation on the primary part changes keyboard activation of… · New
6 resolved since last review
Re-enabling ignores the requested SplitButton focusability Native Space activation is suppressed for the menu button Tab navigation cannot move between SplitButton parts SplitButton part bounds become stale after resizing Roving tabindex adds an unintended SplitButton tab stop Part labels do not update when content changes
Review effort: Balanced
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242808 found UI Test snapshots differences: Details
|
|
|
|
This pull request is merged. |
|
Claude finished @morning4coffe-dev's task in 26s —— View job PR review: SplitButton a11y on WASM (latest push)Verdict: fix-first. This is a Code review only. I did not build or run any tests. The earlier threads are resolved. These cover label refresh, the extra tab stop, resize, Space on the menu button, and re-enable focusability. Four issues from the latest Copilot pass are still open, and I agree with all of them. Three are posted inline; the fourth is below because it is in a file the PR doesn't touch. Issues: 0 high, 4 medium. Cross-cutting (not inline,
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 246605 found UI Test snapshots differences: Details
|
- Mirror each template part's own enabled state: CanExecute == false disables only the primary part, which now hands the tab stop to the menu part. - Re-send the menu part's measured width after layout, so a node built before layout (OnChildAdded) no longer keeps a zero-width menu part. - Let Enter/Space on the primary part reach the managed SplitButton (Click, Command, ToggleSplitButton toggle) and suppress only the duplicate native click; the menu part still stops them. - Resolve a focused part to its node in the modal focus trap and focus nodes through the part delegation.
|
Claude finished @morning4coffe-dev's task in 19s —— View job Review: SplitButton a11y on WASM (latest push
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247191 found UI Test snapshots differences: Details
|
MartinZikmund
left a comment
There was a problem hiding this comment.
LGTM. Checked against SplitButtonAutomationPeer.cpp / ToggleSplitButtonAutomationPeer.cpp: both parts drive the split button's own Invoke/Toggle + ExpandCollapse patterns, the template parts stay Raw and the secondary name is the same SR_SplitButtonSecondaryButtonName. ARIA has no split-button role and a single role=button would leave the menu unreachable for touch screen readers, so the group of two buttons is a justified divergence. Single tab stop matches WinUI too.
Optional nits, not blocking:
OnSizeOrOffsetChangednow firesUpdateSplitButtonGeometryfor the split button and each of its parts, so up to 3 interop calls per layout pass. You could limit it to the split button /SecondaryButtonPart, or skip it when the width did not change.accesskey/aria-keyshortcutsstill go to the group div. Since the group is never focusable, anAccessKeyon a SplitButton won't activate anything. Moving them to the primary part would fix that.
A peer started with IsEnabled=true cached, so a peer created while its owner was disabled never raised IsEnabled when the owner was re-enabled. Record the current values when the peer is created, as WinUI's first automatic-property pass does.
EnsureAccessibilityEnabledAsync replaces the window content, so the host loaded before it was never laid out.
|
Claude finished @morning4coffe-dev's task in 22s —— View job Review: SplitButton a11y on WASM (latest push
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247568 found UI Test snapshots differences: Details
|

GitHub Issue: tracked internally
PR Type:
🐞 Bugfix
What changed? 🚀
WinUI exposes a
SplitButtonas one UIA element with Invoke (Toggle forToggleSplitButton) for the primary action and ExpandCollapse for the menu; its template buttons areRaw. ARIA has no such role, and on WebAssembly the split button became a single generic node, so the menu could not be reached.It is now a
role="group"with two buttons driven by the split button's own patterns (the template staysRaw):aria-pressed);SplitButtongives that part, as in WinUI):aria-haspopup="menu",aria-expandedfollowing the flyout, expands/collapses.The group only carries an explicit
AutomationProperties.Name, and the part names follow runtime changes. As in WinUI, the split button is a single tab stop (the primary button; Alt+Down / F4 open the menu); the menu button is reachable by screen readers. Focus on either button is focus on the split button.PR Checklist ✅
Given_AccessibleSplitButton)Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_014Yqdfa3riPcqH6MfsxZxmw