Skip to content

Commit

Permalink
get rid of build error
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenOlano committed Nov 24, 2024
1 parent f008207 commit fad9409
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/searchBar/DebouncedSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export const DebouncedSearchBar = <T extends SearchElement>({
setSelectedIndex(Math.max(selectedIndex - 1, 0));
break;
case 'Enter':
if (searchResults && searchResults[selectedIndex]) {
onClick?.(searchResults[selectedIndex]);
const selectedItem = searchResults?.[selectedIndex];
if (selectedItem) {
onClick?.(selectedItem);
}
break;
}
Expand Down

0 comments on commit fad9409

Please sign in to comment.