mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-26 01:46:18 -05:00
Fixing error where focusing on an empty Directory search would throw an error.
This commit is contained in:
parent
bf1ec42cc7
commit
16070e98b3
3 changed files with 30 additions and 4 deletions
|
|
@ -1200,8 +1200,9 @@ export const useSearchDirectories = (value) => {
|
|||
}, [directoryName]);
|
||||
|
||||
useEffect(() => {
|
||||
// Directory value was changed above.
|
||||
setDirectoryName(value);
|
||||
// Directory value was changed above. Coerce null/undefined (an unset form field) to an
|
||||
// empty string so the controlled input stays controlled and never builds a null result.
|
||||
setDirectoryName(value ?? '');
|
||||
}, [value]);
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue