Skip to content

[a11y] Add expanded state in Semantics widget on Android #92040

Closed

Description

@GabrieleSuzart

Use case

I cannot set expanded or collapsed states for screen readers. This accessibility issue is WCAG's conformance level A, Criterion 4.1.2: Name, Role, Value
WCAG: https://www.w3.org/WAI/WCAG21/Understanding/name-role-value

I would like the Semantics widget to have an expanded parameter so that it announces the state for VoiceOver and TalkBack.

After creating this parameter in Semantics, I recommend putting it in the Material's Accordion and similar components.

Proposal

Analyze the behavior of the accessibilityState={{expanded: true}} parameter of React Native and do the same.

https://github.com/facebook/react-native/search?q=expanded

Extra

W3C Documentation about HTML's aria-expanded: https://www.w3.org/WAI/GL/wiki/Using_aria-expanded_to_indicate_the_state_of_a_collapsible_element

React Native documentation about accessibilityState: https://reactnative.dev/docs/accessibility#accessibilitystate

Example of accordion accessible in react material design: https://mui.com/pt/components/accordion/

Activity

  1. changed the title [-]Add expanded state in Semantics widget[/-] [+][Proposal] Add expanded state in Semantics widget[/+] on Oct 19, 2021
  2. added
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    and removed
    in triagePresently being triaged by the triage team
    on Oct 19, 2021
  3. goderbauer commented on Oct 20, 2021

    @goderbauer
    Member

    What does this map to in Android's and iOS's accessibility API?

  4. GabrieleSuzart commented on Oct 27, 2021

    @GabrieleSuzart
    Author

    Searching, I found the map in Android: AccessibilityNodeInfoCompat.ACTION_EXPAND or AccessibilityNodeInfoCompat.ACTION_COLLAPSE on the AccessibilityNodeInfo

    Luckily I found a property called isExpanded in init. It's possible that this is it, but I'm not sure and I don't know how to test it, as I had never used native languages. @goderbauer could you test and confirm?

  5. GabrieleSuzart commented on Oct 29, 2021

    @GabrieleSuzart
    Author

    I got a response on Stack Overflow from an accessibility expert:

    UIAccessibilityTraits is how states are indicated. It's part of UIAccessibility and not part of Swift, but you can set UIAccessibilityTraits from Swift. However, iOS does not have a natively supported expand/collapse property, unlike Android. You'll have to code around it by using accessibilityHint.

    By: slugolicious

  6. added
    P2Important issues not at the top of the work list
    on Feb 23, 2022
  7. 24 remaining items

  8. moved this from In progress to PR submitted in Nevercodeon Sep 6, 2025
  9. moved this from PR submitted to Done (PR merged) in Nevercodeon Sep 27, 2025
  10. added
    r: solvedIssue is closed as solved
    revertAutorevert PR (with "Reason for revert:" comment)
    and removed
    blockedIssue is blocked by another issue
    revertAutorevert PR (with "Reason for revert:" comment)
    on Sep 27, 2025
  11. rekire commented on Sep 28, 2025

    @rekire
    Contributor

    I'm not sure if I run into a merge conflict or something similar, but in my current dev branch has semantics.dart an unresolved reference to SemanticsAction.collapse and SemanticsAction.expand. Is this a known issue? Git blame references this ticket here, so I'm a bit confused.

    I just notices that the file is in bin/cache/pkg/sky_engine/lib/ui/semantics.dart does that mean that I have a incompatible sky_engine version? How can I fix it?

  12. ksokolovskyi commented on Sep 29, 2025

    @ksokolovskyi
    Contributor

    I'm not sure if I run into a merge conflict or something similar, but in my current dev branch has semantics.dart an unresolved reference to SemanticsAction.collapse and SemanticsAction.expand. Is this a known issue? Git blame references this ticket here, so I'm a bit confused.

    I just notices that the file is in bin/cache/pkg/sky_engine/lib/ui/semantics.dart does that mean that I have a incompatible sky_engine version? How can I fix it?

    Hi @rekire, please make sure that you have merged the latest master into your dev branch. If yes, then try to remove bin/cache folder and run flutter doctor to download the fresh sky_engine. I hope this helps.

  13. github-actions commented on Oct 13, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: castawayframeworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyr: solvedIssue is closed as solvedteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions