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({
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();
}