Fixed infinite saving when input was connected

This commit is contained in:
Lucas Oliveira 2023-12-31 12:07:07 -03:00
commit 1ec50a2f27

View file

@ -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">