Skip to content

Fix: TalkBack should highlight controls instead of their ancestors - #21654

Merged
MrJul merged 3 commits into
AvaloniaUI:masterfrom
IsaMorphic:feature/fix-android-talkback
Jul 3, 2026
Merged

MrJul merged 3 commits into
AvaloniaUI:masterfrom
IsaMorphic:feature/fix-android-talkback

Conversation

@IsaMorphic

@IsaMorphic IsaMorphic commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

What does the pull request do?

This PR fixes a regression in the Android TalkBack feature which causes certain controls to become unresponsive to touch exploration, even though they are navigable otherwise. The regression is due to an internal Avalonia API update to the Visual.FindAncestorOfType(bool) method which ignores the calling instance by default (i.e. includeSelf: false).

What is the current behavior?

The current behavior is for Avalonia to find the nearest ancestor for a given Visual instance when hovered over by the user. This is incorrect.

What is the updated/expected behavior with this PR?

The expected / correct behavior is for Avalonia to give the nearest ancestor for the given Visual, or, if that instance is a valid Control, return a reference to it, instead. Additionally, some exceptions are made for non-container controls which are parents of leaf controls. In these cases, a reference to those parents is returned instead of the leaf.

Checklist

@avaloniaui-bot

Copy link
Copy Markdown

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

@IsaMorphic
IsaMorphic marked this pull request as draft June 26, 2026 19:03
@IsaMorphic IsaMorphic changed the title Fix: TalkBack should highlight controls instead of their ancestors [WIP] TalkBack should highlight controls instead of their ancestors Jun 26, 2026
@IsaMorphic IsaMorphic changed the title [WIP] TalkBack should highlight controls instead of their ancestors Fix: TalkBack should highlight controls instead of their ancestors Jun 26, 2026
@IsaMorphic
IsaMorphic marked this pull request as ready for review June 26, 2026 19:56
@avaloniaui-bot

Copy link
Copy Markdown

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

@MrJul MrJul added bug os-android area-accessibility backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels Jun 30, 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 July 3, 2026 08:03
@MrJul
MrJul added this pull request to the merge queue Jul 3, 2026
@avaloniaui-bot

Copy link
Copy Markdown

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

Merged via the queue into AvaloniaUI:master with commit 0f4fb6e Jul 3, 2026
11 checks passed
@IsaMorphic
IsaMorphic deleted the feature/fix-android-talkback branch July 3, 2026 14:31
@MrJul MrJul removed the backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch label Jul 9, 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