mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 20:59:56 -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
|
|
@ -1473,7 +1473,9 @@ export function DirectorySearch({onSelect, value, disabled, required, ...props})
|
|||
const newDirectory = isDir ? {} : {
|
||||
newDirectory: {
|
||||
name: 'New Directory',
|
||||
results: [{title: directoryName}],
|
||||
// title must not be null; an unset form field passes a null value and
|
||||
// Semantic UI's Search crashes reading null.length.
|
||||
results: [{title: directoryName || ''}],
|
||||
}
|
||||
};
|
||||
const newResults = {
|
||||
|
|
@ -1537,7 +1539,7 @@ export function DirectorySearch({onSelect, value, disabled, required, ...props})
|
|||
onResultSelect={handleResultSelect}
|
||||
onBlur={handleBlur}
|
||||
loading={loading}
|
||||
value={directoryName}
|
||||
value={directoryName || ''}
|
||||
results={results}
|
||||
disabled={disabled}
|
||||
{...props}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue