Skip to content

Expose tree item selection to macOS accessibility - #21598

Merged
MrJul merged 5 commits into
masterfrom
feature/macos-ax-treeitem-selection
Jun 16, 2026
Merged

MrJul merged 5 commits into
masterfrom
feature/macos-ax-treeitem-selection

Conversation

@jmacato

@jmacato jmacato commented Jun 16, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

Lets macOS accessibility select a TreeViewItem, so AX clients can set a tree item's selected state via setAccessibilitySelected.

What is the current behavior?

TreeViewItemAutomationPeer does not implement ISelectionItemProvider, and the macOS peer has no setAccessibilitySelected:, so a tree item exposes no selection to AX clients.

What is the updated/expected behavior with this PR?

TreeViewItemAutomationPeer implements ISelectionItemProvider, and AvnAccessibilityElement routes setAccessibilitySelected: to it, so AX clients can read and set a tree item's selection.

How was the solution implemented (if it's not obvious)?

TreeViewItemAutomationPeer maps IsSelected / Select / SelectionContainer to the TreeViewItem and its owning TreeView. The native peer exposes a SelectionItemProvider_Select bridge method, and AvnAccessibilityElement implements setAccessibilitySelected: along with the matching isAccessibilitySelectorAllowed: case.

Breaking changes

None.

TreeViewItemAutomationPeer implements ISelectionItemProvider, and AvnAccessibilityElement maps setAccessibilitySelected to it, so AX clients can select a TreeViewItem.
@MrJul MrJul added the backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch label Jun 16, 2026
MrJul
MrJul previously approved these changes Jun 16, 2026

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrJul
MrJul enabled auto-merge June 16, 2026 14:36
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066499-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066509-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066525-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue Jun 16, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066538-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Merged via the queue into master with commit e08c7f8 Jun 16, 2026
11 checks passed
@MrJul
MrJul deleted the feature/macos-ax-treeitem-selection branch June 16, 2026 20:29
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request Jun 23, 2026
TreeViewItemAutomationPeer implements ISelectionItemProvider, and AvnAccessibilityElement maps setAccessibilitySelected to it, so AX clients can select a TreeViewItem.
@MrJul MrJul added backported-12.0.x and removed backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants