You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toggle buttons as an <input /> aren't very accessible (keyboard controls for buttons and inputs are different and voice control software won't recognize what you're trying to do)
What to do?
Switch to using a <button />
Either
require two label props (one for the "on" state, another for the "off" state)
if only one label is provided, set aria-pressed="true|false" (people could abuse this and change the single string they pass in so we might want to cache the first string recieved so implementing developers see that they did it wrong)
(all of these "label" props should probably actually be an object to allow for a string and an icon to be passed in)
The text was updated successfully, but these errors were encountered:
Summary
Toggle buttons as an
<input />
aren't very accessible (keyboard controls for buttons and inputs are different and voice control software won't recognize what you're trying to do)What to do?
<button />
aria-pressed="true|false"
(people could abuse this and change the single string they pass in so we might want to cache the first string recieved so implementing developers see that they did it wrong)The text was updated successfully, but these errors were encountered: