diff --git a/src/components/Search/Search.tsx b/src/components/Search/Search.tsx index 9a8f2f2cb..aaebaef56 100644 --- a/src/components/Search/Search.tsx +++ b/src/components/Search/Search.tsx @@ -213,7 +213,7 @@ export const Search: FC = ({ // eslint-disable-next-line unicorn/consistent-function-scoping const emitIfClickingOutsideSearch = (event: DocumentEventMap['click']) => { if (disabled) return; - if (!containerRef.current.contains(event.target as Element)) { + if (!containerRef.current?.contains(event.target as Element)) { setShowResults(false); } else { setShowResults(true);