Skip to content

Commit

Permalink
Add inline comments
Browse files Browse the repository at this point in the history
Signed-off-by: Souptik Datta <[email protected]>
  • Loading branch information
Souptik2001 committed May 16, 2024
1 parent e260bc5 commit 0eca289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/content-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,10 @@ const ContentSearch: React.FC<ContentSearchProps> = ({
const hasSearchResults = searchResults && !!searchResults.length;
const hasInitialResults = fetchInitialResults && isFocused;

// Add event listener to close search results when clicking outside of the search container.
useEffect(() => {
document.addEventListener('mouseup', (e: MouseEvent) => {
// Bail if search control or search results container is clicked.
// Bail if anywhere inside search container is clicked.
if (
searchContainer.current?.contains(e.target as Node)
) {
Expand Down

0 comments on commit 0eca289

Please sign in to comment.