Browse Source

[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>
David 2 years ago
parent
commit
1b8ee3b672
1 changed files with 3 additions and 0 deletions
  1. 3 0
      kafka-ui-react-app/src/components/common/Search/Search.tsx

+ 3 - 0
kafka-ui-react-app/src/components/common/Search/Search.tsx

@@ -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);