maui icon indicating copy to clipboard operation
maui copied to clipboard

TalkBack doesn't navigate to headings contained in StackLayout with a SemanticProperties.Description

Open gbarkerz opened this issue 2 years ago • 9 comments

Description

I needed to create a page containing multiple headings, so set SemanticProperties.HeadingLevel on particular labels. I also needed to create nested groupings with nesting that's accessible to screen readers, and in order to achieve this, I set SemanticProperties.Description on some StackLayouts. This worked well on Windows with the Narrator screen reader, and I mentioned how useful this was at https://twitter.com/gbarkerZ/status/1543533603921006592?s=20&t=cRkhQlhf4LSAISDmZZjFEQ.

I then built it and ran on Android, and found that the TalkBack screen reader apparently won't navigate to any headings that lie in a StackLayout with a SemanticProperties.Description. So the necessary navigation by headings doesn't work.

My version of .NET is 6.0.400-preview.22301.10,

Steps to Reproduce

  1. Build and run an Android version of the app at https://github.com/gbarkerz/MyVeryFirstMauiApp. The code of interest is in https://github.com/gbarkerz/MyVeryFirstMauiApp/blob/master/MyVeryFirstMauiApp/MainPage.xaml.

  2. Turn on the TalkBack screen reader on the Android device, set TalkBack's reading control to navigate by headings, and move forward through the headings in the app.

  3. TalkBack moves through most headings in the app, but bypasses the heading that's contained in the StackLayout with the SemanticProperties.Description.

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 9

Did you find any workaround?

No response

Relevant log output

No response

gbarkerz avatar Jul 04 '22 21:07 gbarkerz

Verified with MyVeryFirstMauiApp-master.zip

jsuarezruiz avatar Jul 05 '22 07:07 jsuarezruiz

Based on further experiments, it seems that VoiceOver on Mac behaves the same way at the app as TalkBack does on Android, in that it bypasses headings contained in StackLayouts with a SemanticProperties.Description.

gbarkerz avatar Jul 05 '22 21:07 gbarkerz

GitHubTags: #.NET MAUI; #A11ySev2; #A11yMAS; #A11yTCS; #Benchmark; #Android; #WCAG2.1.1; #GH_.NETMAUI_Android_Apr2022; #AILimited​;

Karan4495 avatar Sep 15 '22 11:09 Karan4495

@gbarkerz @Karan4495 This isn't really an accessibility issue with .NET MAUI

If you remove the ScrollView from the MAUI app then it all works as @gbarkerz describes. It looks like this is just how Android groups the behavior on Android

If you use the following code on Android you'll see the exact same behavior that .NET MAUI has

If you remove the ScrollView then talkback is unable to navigate to any of

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="wrap_content"
            android:contentDescription="I am the linear layout"
            android:importantForAccessibility="yes"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:accessibilityHeading="true"
                android:text="Hello there people"
                ></TextView>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="wakka wakka"
                ></TextView>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:accessibilityHeading="true"
                android:text="Hello there people"
                ></TextView>
        </androidx.appcompat.widget.LinearLayoutCompat>
    </ScrollView>

PureWeen avatar Sep 29 '22 22:09 PureWeen

@PureWeen then does this indicate that it's not really a bug and can be resolved as such?

merriemcgaw avatar Oct 04 '22 20:10 merriemcgaw

@merriemcgaw I'd say there are two options here

  1. close as not a bug
  2. lower the severity level and research to determine if it's a platform bug. I'm not sure at the Android level if this would be perceived as "By Design" or "Talk back bug"

I lean towards option two. Keeping something like this around also gives anyone a place to indicate if they are running into this same issue.

We can do some research here and log the bug with Android to see how they mark it.

PureWeen avatar Oct 04 '22 20:10 PureWeen

@PureWeen Thanks for the investigation, it's interesting to learn that this seems to be underlying Android behavior. It would be good to know how a related issue against Android would be considered. My original UI design seemed reasonable to me, ie having headings inside semantic groups, but at least if the current behavior doesn't change, I'll know to explicitly avoid designing this type of UI layout in an Android app in the future.

gbarkerz avatar Oct 05 '22 13:10 gbarkerz

Android App demonstrating the same behavior

2022-10-20_10-14-26

Android App if you remove the scrollview

2022-10-20_10-15-05

PureWeen avatar Oct 20 '22 15:10 PureWeen

Workaround: Add AutomationProperties.IsInAccessibleTree="False" to the ScrollView

rachelkang avatar Oct 27 '22 17:10 rachelkang

Hi Shane The issue is Reproducing in the "My Application" Can you please provide us the sample app to log external bug to talk back. Thanks.

keerthiduvvuri avatar Nov 02 '22 10:11 keerthiduvvuri

Hi @keerthiduvvuri . reposting the code example that @PureWeen added in a previous comment.


    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="wrap_content"
            android:contentDescription="I am the linear layout"
            android:importantForAccessibility="yes"
            android:layout_height="wrap_content">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:accessibilityHeading="true"
                android:text="Hello there people"
                ></TextView>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="wakka wakka"
                ></TextView>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:accessibilityHeading="true"
                android:text="Hello there people"
                ></TextView>
        </androidx.appcompat.widget.LinearLayoutCompat>
    </ScrollView>

rperez030 avatar Nov 02 '22 21:11 rperez030

Workaround: Add AutomationProperties.IsInAccessibleTree="False" to the ScrollView

Animation

rachelkang avatar Nov 04 '22 14:11 rachelkang

Hi Shane As per discussion with SME we have to reduce the severity of this bug to sev3, and I have raised a third party bug to talkback which is tracked by https://dev.azure.com/CSS-IRT/CSS%20IRT/_workitems/edit/202560 and we can close this bug(I am not having access to close this bug). Thanks.

keerthiduvvuri avatar Nov 23 '22 07:11 keerthiduvvuri