Fix model deletion

This commit is contained in:
Gregory Schier
2025-05-21 08:25:12 -07:00
parent c2f9760d08
commit d8b1cadae6
3 changed files with 5 additions and 11 deletions

View File

@@ -174,15 +174,12 @@ const BaseInput = forwardRef<EditorView, InputProps>(function InputBase(
);
const isValid = useMemo(() => {
console.log('CHECKING VALIDITY', validate);
if (required && !validateRequire(defaultValue ?? '')) return false;
if (typeof validate === 'boolean') return validate;
if (typeof validate === 'function' && !validate(defaultValue ?? '')) return false;
return true;
}, [required, defaultValue, validate]);
console.log('IS VALID', isValid, defaultValue);
const handleChange = useCallback(
(value: string) => {
onChange?.(value);