Skip to content

Commit

Permalink
fix: clear results on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Sep 18, 2024
1 parent 1a0feee commit aa11873
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/site/src/components/Navigation/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export function Search({ className, doSearch }: { className?: string; doSearch:
}
}, []);

// Clear search state on close
useEffect(() => {
if (!open) {
setSearchResults([]);
}
}, [open]);

// Mount the document event handlers
useEffect(() => {
// attach the event listener
Expand Down

0 comments on commit aa11873

Please sign in to comment.