File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/pf3-component-mapper/src/form-fields Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ class Switch extends React.Component {
5353 < label
5454 className = { `pf3-switch${ disabled || isReadOnly ? ' disabled' : '' } ${ bsSize === 'mini' || bsSize === 'mn' ? ' mini' : '' } ` }
5555 style = { { width : this . state . labelWidth + DIVIDER_SIZE + COMBINED_MARGIN } }
56+ tabIndex = { disabled || isReadOnly ? - 1 : 0 }
57+ onKeyDown = { ( e ) => {
58+ const SPACEBAR_CODE = 32 ;
59+ if ( e . keyCode === SPACEBAR_CODE ) {
60+ e . preventDefault ( ) ;
61+ props . onChange ( { target : { checked : ! props . checked } } ) ;
62+ }
63+ } }
5664 >
5765 < input type = "checkbox" { ...props } disabled = { disabled || isReadOnly } />
5866 < span className = { `pf3-switch-slider${ props . checked ? ' checked' : '' } ` } >
You can’t perform that action at this time.
0 commit comments