Repository navigation
fix(a11y): label ExtendedFloatingActionButtons for screen readers - #22
Merged
Merged
Conversation
The three-slot ExtendedFloatingActionButton keeps its label in the text slot, which Material3 wraps in an AnimatedVisibility for the expand/collapse animation. That can drop the text's semantics, leaving the merged FAB node unlabeled - it exposes no name, content-description or clickable node to the accessibility tree (confirmed via uiautomator on the home "Switch" button). TalkBack users can't find or activate it. Set the label directly on each affected FAB via semantics contentDescription so it never depends on the animated child, and add a testTag for UI automation. Covers all four instances of this pattern: home Switch, New poll, New reminder, New invite. The plain FloatingActionButtons elsewhere already label their icon, so they're unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The home "Switch" FAB exposes no node to the accessibility tree - no name, no content-description, no clickable node at its bounds (confirmed via a uiautomator dump). TalkBack users cannot perceive or activate the home screen's primary action.
Root cause: the three-slot
ExtendedFloatingActionButtonkeeps its label in thetextslot, which Material3 wraps in anAnimatedVisibilityfor the expand/collapse animation. That wrapper can drop the text's semantics, leaving the merged FAB node unlabeled - and an unlabeled merged clickable node effectively disappears from the a11y tree.Fix
Set the accessibility label directly on each affected FAB via
Modifier.semantics { contentDescription = ... }, so the label never depends on the animated child, plus atestTagfor UI automation.Same construction (icon
contentDescription = null+ label in thetextslot) exists in four places, so all four are fixed for consistency:home_switch_fabpolls_new_fabreminders_new_fabchannels_new_fabThe plain
FloatingActionButtons elsewhere (Members, Groups, Journals, People, Custom fields) already give theirIconacontentDescription, so they were never affected and are left as-is.Testing
:app:testPlayReleaseUnitTestgreen:app:assemblePlayReleasegreen (through R8)