File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/components/form-elements/date-input Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,9 @@ type DateInputValue = {
1313 year : string ;
1414} ;
1515
16- export type DateInputChangeEvent = ChangeEvent < HTMLInputElement > & {
17- target : HTMLInputElement & { value : DateInputValue } ;
18- currentTarget : HTMLInputElement & { value : DateInputValue } ;
19- } ;
16+ export type DateInputChangeEvent = ChangeEvent <
17+ Omit < HTMLInputElement , 'value' > & { value : DateInputValue }
18+ > ;
2019
2120interface DateInputProps
2221 extends Omit < HTMLProps < HTMLDivElement > , 'value' | 'defaultValue' > ,
@@ -69,15 +68,16 @@ const DateInputComponent = ({
6968 event . stopPropagation ( ) ;
7069
7170 if ( onChange ) {
72- const newEventValue = {
71+ const newEventValue : DateInputValue = {
7372 ...internalDate ,
7473 [ inputType ] : event . target . value ,
7574 } ;
76- const newEvent = {
75+
76+ const newEvent : DateInputChangeEvent = {
7777 ...event ,
7878 target : { ...event . target , value : newEventValue } ,
7979 currentTarget : { ...event . currentTarget , value : newEventValue } ,
80- } as DateInputChangeEvent ;
80+ } ;
8181
8282 onChange ( newEvent ) ;
8383 setInternalDate ( newEventValue ) ;
You can’t perform that action at this time.
0 commit comments