Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch component doesn't respect aria-label property: must use deprecated accessibilityLabel #2549

Closed
1 task done
kpcurai opened this issue Jul 7, 2023 · 0 comments
Closed
1 task done
Labels
Milestone

Comments

@kpcurai
Copy link

kpcurai commented Jul 7, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The aria-label prop is applied to the enclosing View component of a Switch, which is not an accessible pattern.

When the deprecated accessibilityLabel prop is used, it correctly is applied to the native input component, but makes loud deprecation warnings.

Expected behavior

I would expect an aria-label prop to pass through to the input element, not be placed on the View component.

Steps to reproduce

  • version 0.19.4
  • use the Switch component with aria-label prop and observe it does not get applied to the input element
  • use the Switch component with accessibilityLabel and observe it does get applied to the input element

Test case

https://codesandbox.io/s/switch-deprecated-accessibilitylabel-9v6md8?file=/src/App.js

Additional comments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants