Skip to content

Conversation

FarisMarouane
Copy link

When running Web vitals test on a web page using react-toggle, the test complains that there's no accompanying label to the input.

You could surround the Toggle component with a label tag, but it messes up with the styling.

I am talking of cases where you don't need any visible label (before the toggle for instance).

This PR just add a label tag, with the already existing css class "react-toggle-screenreader-only"; before the input element when an id prop is specified. This is done to improve the library accessibility.

Thank you !

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.

1 participant