Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1900 | clearing out search term on route ch…
Browse files Browse the repository at this point in the history
…ange
  • Loading branch information
snyaggarwal committed Oct 3, 2024
1 parent ed98a14 commit f425f17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/search/SearchInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ const SearchInput = props => {
setInput(queryParams.get('q') || '')
}, [])

React.useEffect(() => {
if(location.pathname !== '/search/')
setInput('')
}, [location.pathname])


const inputProps = {
input: input || '',
Expand Down

0 comments on commit f425f17

Please sign in to comment.