Skip to content

fix(fab,switch): forward accessibilityActions on FAB and aria-labelledby on Switch - #5190

Open
jay23606 wants to merge 2 commits into
callstack:mainfrom
jay23606:pr-go/5188-fab-drops-accessibilityactions-and-switc
Open

jay23606 wants to merge 2 commits into
callstack:mainfrom
jay23606:pr-go/5188-fab-drops-accessibilityactions-and-switc

Conversation

@jay23606

@jay23606 jay23606 commented Nov 7, 2026 •

Copy link
Copy Markdown

Bug

FAB dropped accessibilityActions and onAccessibilityAction; Switch accepted aria-label but not aria-labelledby.

Change

Forwarded both accessibility action props to the focusable FAB (including FAB/Shell) and aria-labelledby to the switch.

Testing

  • FAB and Switch regression tests pass (27 tests).
  • npx tsc --noEmit -p tsconfig.json and targeted ESLint pass.
  • The Switch regression 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

Copilot AI balanced review requested due to automatic review settings November 7, 2026 12:32
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Found potential problems with the pull request:

  • Screenshot or video evidence is missing. Make sure to include one if it affects the UI.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-labelledby support 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

Comment thread src/components/FAB/FAB.tsx Resolved
Copilot AI balanced review requested due to automatic review settings November 7, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the FAB and Switch accessibility prop changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FAB drops accessibilityActions and Switch drops aria-labelledby, with no replacement

2 participants