diff --git a/src/app/WardrobePage/SearchToolbar.js b/src/app/WardrobePage/SearchToolbar.js index 468cad4..e4f2d55 100644 --- a/src/app/WardrobePage/SearchToolbar.js +++ b/src/app/WardrobePage/SearchToolbar.js @@ -47,7 +47,7 @@ export function searchQueryIsEmpty(query) { function SearchToolbar({ query, searchQueryRef, - firstSearchResultRef, + firstSearchResultRef = null, onChange, autoFocus, showItemsLabel = false, @@ -77,7 +77,7 @@ function SearchToolbar({ zoneLabels.sort(); const onMoveFocusDownToResults = (e) => { - if (firstSearchResultRef.current) { + if (firstSearchResultRef && firstSearchResultRef.current) { firstSearchResultRef.current.focus(); e.preventDefault(); }