Fixed infinite saving when input was connected
This commit is contained in:
parent
13e3d6fc19
commit
1ec50a2f27
1 changed files with 2 additions and 2 deletions
|
|
@ -24,10 +24,10 @@ export default function InputComponent({
|
||||||
const refInput = useRef<HTMLInputElement>(null);
|
const refInput = useRef<HTMLInputElement>(null);
|
||||||
// Clear component state
|
// Clear component state
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled && value !== "") {
|
||||||
onChange("");
|
onChange("");
|
||||||
}
|
}
|
||||||
}, [disabled, onChange]);
|
}, [disabled]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative w-full">
|
<div className="relative w-full">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue