Skip to content

a11y ListTile focusability on Android #12080

@goderbauer

Description

@goderbauer

Turns out, telling Android which nodes should be focusable (as we do in flutter/engine#4067) is not enough to convince Android that a node should be focusable.

Example of broken focusability:

              new ListTile(
                onTap: () {
                  print('The ListTile was tapped!');
                },
                trailing: new IconButton(
                  icon: new Icon(Icons.volume_up),
                  onPressed: () {
                    print('The icon was pressed!');
                  },
                ),
              ),

Expectation here is that you can focus the ListTile itself (to trigger the first print) and the encapsulated IconButton (to trigger the second print). However, Android thinks that only the IconButton is focus-worthy even though both nodes are marked as focusable in Android's accessibility tree :

09-13 14:45:43.796 15099 15099 V TreeDebug:               (31061)185Flutter:(0, 280 - 1440, 476):AC:focusable:clickable
09-13 14:45:43.796 15099 15099 V TreeDebug:                 (31092)185Flutter:(1216, 294 - 1384, 462):aC:focusable:clickable

Why's that? Well, Android uses a complicated algorithm to determine if a node should actually be focusable or not (see flow chart on https://code.facebook.com/posts/391276077927020/android-accessibility-debugging-with-stetho/).

Not sure how much of an issue this is. In this particular example its unlikely that in the real world ListTile would not provide a semantics label (which according to the flow chart) would make it focusable. Maybe there are other edge cases that will not resolve that easily?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)found in release: 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions