mirror of https://gitee.com/answerdev/answer.git
fix: clear search input val when navigate to other page
This commit is contained in:
parent
c620d466f1
commit
4bfa98df6c
|
@ -95,6 +95,11 @@ const Header: FC = () => {
|
|||
toggle?.click();
|
||||
}
|
||||
}
|
||||
|
||||
// clear search input when navigate to other page
|
||||
if (location.pathname !== '/search' && searchStr) {
|
||||
setSearch('');
|
||||
}
|
||||
}, [location.pathname]);
|
||||
|
||||
let navbarStyle = 'theme-colored';
|
||||
|
|
Loading…
Reference in New Issue