Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] SemanticProperties.HeadingLevel not working in ListView #21830

Open
ramonB1996 opened this issue Apr 15, 2024 · 6 comments
Open

[Android] SemanticProperties.HeadingLevel not working in ListView #21830

ramonB1996 opened this issue Apr 15, 2024 · 6 comments
Labels
area-controls-listview ListView and TableView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/a11y Relates to accessibility t/bug Something isn't working
Milestone

Comments

@ramonB1996
Copy link

ramonB1996 commented Apr 15, 2024

Description

I am trying to make a Label inside a ListView accessible by using SemanticProperties.HeadingLevel="Level1". This should be used by Android Talkback and tell the user that the label is a heading. Sadly, that part seems to be ignored inside a ListView

This works correctly on iOS!

Please let me know if there are any questions :)

Steps to Reproduce

  1. Clone: https://github.com/ramonB1996/MauiListViewA11yIssue
  2. Enable Talkback
  3. Confirm the bug when going through the items in the list

Link to public reproduction project repository

https://github.com/ramonB1996/MauiListViewA11yIssue

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

Sadly, no.

In Xamarin.Forms we created an A11YEffect that added these lines of code when a label should be a heading:

ViewCompat.SetAccessibilityHeading(control, true);
if (Build.VERSION.SdkInt >= BuildVersionCodes.P)
    control.AccessibilityHeading = true;

I tried doing this in a Behavior with Maui, but that did not change the outcome.

Relevant log output

No response

@ramonB1996 ramonB1996 added the t/bug Something isn't working label Apr 15, 2024
@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 15, 2024
@ninachen03
Copy link

Verified this issue with Visual Studio 17.10.0 Preview 3 (8.0.20 &8.0.14).I can repro this issue on android(xiaomi)physical.

@jsuarezruiz jsuarezruiz added this to the Backlog milestone Apr 15, 2024
@jsuarezruiz
Copy link
Contributor

Did you try with the CollectionView?

@ramonB1996
Copy link
Author

@jsuarezruiz I tried my sample with a CollectionView instead. This yields the same results as with ListView. It does not work for Android, but works for iOS.

@BlotskiyDmitriy
Copy link

BlotskiyDmitriy commented Apr 30, 2024

@ramonB1996 I found this problem in the maui source code. The fact is that the Heading value is not set to true when necessary. Maybe they just forgot. Also, it didn't work not only for collections, but for all controls

@ramonB1996
Copy link
Author

@BlotskiyDmitriy Thanks for creating a PR on this. However, I am pretty sure this worked on default controls like a Label. Are you sure it does not work everywhere? I thought only collections were a problem.

@BlotskiyDmitriy
Copy link

@ramonB1996 I added your example to the Maui Sandbox and tried to reproduce the problem with a simple Label. After setting the HeadingLevel with the TalkBack function enabled, the phrase "Heading" isn't said

@Eilon Eilon added t/a11y Relates to accessibility area-controls-listview ListView and TableView and removed legacy-area-a11y Relates to accessibility labels May 13, 2024
@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-listview ListView and TableView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/a11y Relates to accessibility t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants