File tree Expand file tree Collapse file tree 5 files changed +6
-6
lines changed
packages/insights-common-typescript/src/components/Formik/Patternfly Expand file tree Collapse file tree 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import { FieldInputProps } from 'formik' ;
3
3
4
- export const onChangePFAdapter = < T = React . FormEvent < HTMLInputElement > , E = boolean > ( field : FieldInputProps < T > ) => {
5
- return ( _ : T , e : E ) => {
4
+ export const onChangePFAdapter = < T = React . FormEvent < HTMLInputElement > > ( field : FieldInputProps < T > ) => {
5
+ return ( e : T ) => {
6
6
return field . onChange ( e ) ;
7
7
} ;
8
8
} ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export const FormSelect: React.FunctionComponent<FormSelectProps> = (props) => {
28
28
< PFFormSelect
29
29
{ ...withoutOuiaProps ( props ) }
30
30
{ ...field }
31
- onChange = { onChangePFAdapter < React . FormEvent < HTMLSelectElement > , string | number > ( field ) }
31
+ onChange = { onChangePFAdapter < React . FormEvent < HTMLSelectElement > > ( field ) }
32
32
isRequired = { props . isRequired }
33
33
validated = { ( isValid ) ? 'default' : 'error' }
34
34
>
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export const FormTextArea: React.FunctionComponent<FormTextAreaProps> = (props)
31
31
value = { field . value || '' }
32
32
validated = { ( isValid ) ? 'default' : 'error' }
33
33
isRequired = { props . isRequired }
34
- onChange = { onChangePFAdapter < React . FormEvent < HTMLTextAreaElement > , string | number > ( field ) }
34
+ onChange = { onChangePFAdapter < React . FormEvent < HTMLTextAreaElement > > ( field ) }
35
35
/>
36
36
{ meta . error && < FormHelperText >
37
37
< HelperText >
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export const FormTextInput: React.FunctionComponent<FormTextInputProps> = (props
33
33
{ ...field }
34
34
validated = { ( isValid ) ? 'default' : 'error' }
35
35
value = { field . value !== undefined ? field . value . toString ( ) : '' }
36
- onChange = { onChangePFAdapter < React . FormEvent < HTMLInputElement > , string | number > ( field ) }
36
+ onChange = { onChangePFAdapter < React . FormEvent < HTMLInputElement > > ( field ) }
37
37
/>
38
38
{ hint && < Text component = { TextVariants . small } > { hint } </ Text > }
39
39
{ meta . error && < FormHelperText >
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export const Switch: React.FunctionComponent<SwitchProps> = (props) => {
34
34
ouiaId = "pf-switch"
35
35
ouiaSafe = { props . ouiaSafe }
36
36
label = { label }
37
- onChange = { onChangePFAdapter < React . FormEvent < HTMLInputElement > , boolean > ( field ) }
37
+ onChange = { onChangePFAdapter < React . FormEvent < HTMLInputElement > > ( field ) }
38
38
/>
39
39
{ meta . error && < FormHelperText >
40
40
< HelperText >
You can’t perform that action at this time.
0 commit comments