[UI] Topic search not working properly with pagination #2705 (#2766)

* added reset page to a search component

* changed search file

Co-authored-by: davitbejanyan <dbejanyan@provectus.com>
Co-authored-by: Oleg Shur <workshur@gmail.com>
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
This commit is contained in:
David 2022-10-25 23:14:40 +04:00 committed by GitHub
parent 5a67adbf3e
commit 1b8ee3b672
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,9 @@ const Search: React.FC<SearchProps> = ({
onChange(e.target.value);
} else {
searchParams.set('q', e.target.value);
if (searchParams.get('page')) {
searchParams.set('page', '1');
}
setSearchParams(searchParams);
}
}, 500);