diff --git a/src/components/Toggle/Toggle.js b/src/components/Toggle/Toggle.js index 2ff036e076..e7af76cf73 100644 --- a/src/components/Toggle/Toggle.js +++ b/src/components/Toggle/Toggle.js @@ -10,6 +10,7 @@ import React from 'react'; import classNames from 'classnames'; import { settings } from 'carbon-components'; import setupGetInstanceId from '../../tools/setupGetInstanceId'; +import { keys, match } from '../../tools/key'; const { prefix } = settings; const getInstanceId = setupGetInstanceId(); @@ -113,6 +114,13 @@ class Toggle extends React.Component { ref={el => { input = el; }} + onKeyUp={evt => { + if (match(evt, keys.ENTER)) { + input.checked = !input.checked; + onChange(evt); + onToggle(input.checked, id, evt); + } + }} />