Skip to content

Customize a11y for TabBars #12432

@goderbauer

Description

@goderbauer

Currently there is no way to customize what a TabBar exposes to a11y. For example, you can't modify the a11y label of a Tab. This is important because if your tab's title is "AD", VoiceOver will read it out as the individual letters "A" and "D" instead of the Word "Ad".

To fix this, developers want to be able to provide a custom a11y label for a tab that's different from what's shown on screen.

In theory you should be able to do this with the help of the Semantics and ExcludeSemantics widgets. However, there is no way to insert that into a TabBar currently. You can't wrap the entire Tab in them because the TabBar only accepts children of a certain type. And you can't wrap just the text of the Tab in them because a Tab takes a string directly [1] and not a Text widget that could be wrapped in a Semantics widget.

[1] https://docs.flutter.io/flutter/material/Tab/text.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions