Fix is valid

This commit is contained in:
Gregory Schier
2024-07-19 15:09:45 -07:00
parent 4e889b1688
commit 66c6ebaacf
2 changed files with 3 additions and 10 deletions

View File

@@ -59,9 +59,10 @@ export const PlainInput = forwardRef<HTMLInputElement, PlainInputProps>(function
const isValid = useMemo(() => {
if (require && !validateRequire(currentValue)) return false;
if (validate && !validate(currentValue)) return false;
if (typeof validate === 'boolean') return validate;
if (typeof validate === 'function' && !validate(currentValue)) return false;
return true;
}, [currentValue, validate, require]);
}, [require, currentValue, validate]);
const handleChange = useCallback(
(value: string) => {