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:
parent
f144158cf1
commit
029df83878
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user