File tree 2 files changed +9
-1
lines changed
packages/keybr-widget/lib/components/textfield
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const TextField = forwardRef(function TextField(
23
23
type = "text" ,
24
24
value,
25
25
onChange,
26
+ onInput,
26
27
...props
27
28
} : TextFieldProps ,
28
29
ref : ForwardedRef < TextFieldRef > ,
@@ -59,11 +60,15 @@ export const TextField = forwardRef(function TextField(
59
60
onChange = { ( event ) => {
60
61
onChange ?.( ( event . target as HTMLTextAreaElement ) . value ) ;
61
62
} }
63
+ onInput = { ( { nativeEvent } ) => {
64
+ onInput ?.( nativeEvent as InputEvent ) ;
65
+ } }
62
66
/>
63
67
) ;
64
68
} else {
65
69
return (
66
70
< input
71
+ { ...props }
67
72
ref = { element as RefObject < HTMLInputElement > }
68
73
className = { clsx (
69
74
styles . root ,
@@ -81,7 +86,9 @@ export const TextField = forwardRef(function TextField(
81
86
onChange = { ( event ) => {
82
87
onChange ?.( ( event . target as HTMLInputElement ) . value ) ;
83
88
} }
84
- { ...props }
89
+ onInput = { ( { nativeEvent } ) => {
90
+ onInput ?.( nativeEvent as InputEvent ) ;
91
+ } }
85
92
/>
86
93
) ;
87
94
}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export type TextFieldProps = {
18
18
readonly type ?: TextFieldType ;
19
19
readonly value ?: string ;
20
20
readonly onChange ?: ( value : string ) => void ;
21
+ readonly onInput ?: ( event : InputEvent ) => void ;
21
22
} & FocusProps &
22
23
MouseProps &
23
24
KeyboardProps ;
You can’t perform that action at this time.
0 commit comments