Fixed onTyping function being called on every type
This commit is contained in:
parent
c3e6414504
commit
4084522528
@ -39,6 +39,7 @@ function setSetIsText(id: string | undefined, isText: boolean, setIsText: Setter
|
|||||||
interface Input<T> extends InputProps<T> {
|
interface Input<T> extends InputProps<T> {
|
||||||
leading?: JSX.Element,
|
leading?: JSX.Element,
|
||||||
trailing?: JSX.Element,
|
trailing?: JSX.Element,
|
||||||
|
onChange?: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Input: Component<Input<HTMLInputElement>> = (
|
export const Input: Component<Input<HTMLInputElement>> = (
|
||||||
@ -88,8 +89,12 @@ export const Input: Component<Input<HTMLInputElement>> = (
|
|||||||
type={ type }
|
type={ type }
|
||||||
placeholder={ placeholder ?? undefined }
|
placeholder={ placeholder ?? undefined }
|
||||||
required={ required }
|
required={ required }
|
||||||
onInput={ () => setSetIsText(id, isText(), setIsText) }
|
onInput={ () => {
|
||||||
onChange={ onChange /*TODO only called after ENTER*/ }/>
|
setSetIsText(id, isText(), setIsText);
|
||||||
|
if (onChange) {
|
||||||
|
onChange();
|
||||||
|
}
|
||||||
|
} } />
|
||||||
{ trailing }
|
{ trailing }
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user