2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Handle null or undefined TextField values (#8066)

- Replace with empty string
This commit is contained in:
Oliver 2024-09-04 15:17:22 +10:00 committed by GitHub
parent f144158cf1
commit 029df83878
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,11 +28,12 @@ export default function TextField({
const { value } = field;
const [rawText, setRawText] = useState(value);
const [rawText, setRawText] = useState<string>(value || '');
const [debouncedText] = useDebouncedValue(rawText, 250);
useEffect(() => {
setRawText(value);
setRawText(value || '');
}, [value]);
const onTextChange = useCallback((value: any) => {