File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
packages/pf3-component-mapper/src/form-fields Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ const selectComponent = ({
72
72
disabled = { isDisabled }
73
73
checked = { input . value }
74
74
onChange = { ( { target : { checked } } ) => input . onChange ( checked ) }
75
+ formOptions = { formOptions }
75
76
/> ,
76
77
[ componentTypes . DATE_PICKER ] : ( ) => < DateTimePicker pristine = { meta . pristine } onChange = { input . onChange } value = { input . value } isDisabled = { isDisabled } { ...rest } /> ,
77
78
} ) [ componentType ] ;
Original file line number Diff line number Diff line change @@ -56,9 +56,13 @@ class Switch extends React.Component {
56
56
tabIndex = { disabled || isReadOnly ? - 1 : 0 }
57
57
onKeyDown = { ( e ) => {
58
58
const SPACEBAR_CODE = 32 ;
59
+ const ENTER_CODE = 13 ;
59
60
if ( e . keyCode === SPACEBAR_CODE ) {
60
61
e . preventDefault ( ) ;
61
62
props . onChange ( { target : { checked : ! props . checked } } ) ;
63
+ } else if ( e . keyCode === ENTER_CODE ) {
64
+ e . preventDefault ( ) ;
65
+ props . formOptions . handleSubmit ( ) ;
62
66
}
63
67
} }
64
68
>
You can’t perform that action at this time.
0 commit comments