Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Keyboard Accessibility #20

Closed
dsuriano opened this issue Nov 13, 2018 · 1 comment
Closed

Keyboard Accessibility #20

dsuriano opened this issue Nov 13, 2018 · 1 comment

Comments

@dsuriano
Copy link

dsuriano commented Nov 13, 2018

The Problem

Keyboard users are currently not able to interact with or toggle a Switch.

The Solution

Within src/scripts/switch.js, add a tabIndex="0" and onKeyPress={e => (enabled ? onClick(e) : onDisabledClick(e))} to the returned containing div.

Bonus Points

Add a proper keypress handler that only listens for enter (keycode 13) and space (keycode 32).

@pgrimard
Copy link
Owner

Closing this issue because this repo is being archived and will no longer be maintained.

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

No branches or pull requests

2 participants