Repository navigation
Conversation
|
Found potential problems with the pull request:
|
There was a problem hiding this comment.
🟡 Changes recommended
The FAB and Shell prop types still reject readonly accessibility action lists, causing TypeScript errors for callers using actions declared with as const.
1 open issue
What changed in this PR
This PR restores accessibility prop forwarding for FAB and Switch, addressing #5188 within the rewritten controls.
Changes:
- Adds custom accessibility actions and their handler to FAB and its shared Shell.
- Adds
aria-labelledbysupport to Switch. - Adds regression tests for both components’ prop forwarding.
| File | Description |
|---|---|
src/components/Switch/Switch.tsx |
Accepts and forwards aria-labelledby to the switch element. |
src/components/FAB/Shell.tsx |
Forwards accessibility actions and their handler to the pressable element. |
src/components/FAB/FAB.tsx |
Exposes accessibility action props and passes them to Shell. |
src/components/__tests__/Switch.test.tsx |
Tests aria-labelledby forwarding. |
src/components/__tests__/FAB.test.tsx |
Tests accessibility action and handler forwarding. |
Review effort: Balanced
This branch has not been deployed
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.

Bug
FABdroppedaccessibilityActionsandonAccessibilityAction;Switchacceptedaria-labelbut notaria-labelledby.Change
Forwarded both accessibility action props to the focusable FAB (including
FAB/Shell) andaria-labelledbyto the switch.Testing
npx tsc --noEmit -p tsconfig.jsonand targeted ESLint pass.Switchregression test fails on base and passes with this fix.This changes accessibility props only; there is no visual change to capture in a screenshot.
Fixes #5188