Fix stray null error in SearchToolbar

Oops, we don't provide this in the item search page, so check for that!
This commit is contained in:
Emi Matchu 2021-02-09 16:05:21 -08:00
parent 107696783e
commit fe5eab5763

View file

@ -47,7 +47,7 @@ export function searchQueryIsEmpty(query) {
function SearchToolbar({ function SearchToolbar({
query, query,
searchQueryRef, searchQueryRef,
firstSearchResultRef, firstSearchResultRef = null,
onChange, onChange,
autoFocus, autoFocus,
showItemsLabel = false, showItemsLabel = false,
@ -77,7 +77,7 @@ function SearchToolbar({
zoneLabels.sort(); zoneLabels.sort();
const onMoveFocusDownToResults = (e) => { const onMoveFocusDownToResults = (e) => {
if (firstSearchResultRef.current) { if (firstSearchResultRef && firstSearchResultRef.current) {
firstSearchResultRef.current.focus(); firstSearchResultRef.current.focus();
e.preventDefault(); e.preventDefault();
} }