1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 20:02:58 +01:00

Make ToggleButton keyboard accessible (#12727)

This commit is contained in:
ryanml 2021-11-17 08:38:20 -07:00 committed by GitHub
parent 889411a0d7
commit dcffd5fbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,12 @@ const ToggleButton = (props) => {
return (
<div
tabIndex="0"
onKeyDown={(e) => {
if (e.key === 'Enter') {
onToggle(value);
}
}}
className={classnames('toggle-button', `toggle-button--${modifier}`, {
'toggle-button--disabled': disabled,
})}