Skip to content

Commit 6f45fa7

Browse files
committed
Consumer search criteria not cleared/used when navigating to another consumer - fixed
The search text will be cleared when switched to different cluster's consumers
1 parent f4c6692 commit 6f45fa7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

frontend/src/components/common/Search/Search.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ const Search: React.FC<SearchProps> = ({
3232
const ref = useRef<ComponentRef<'input'>>(null);
3333

3434
useEffect(() => {
35-
if (ref.current !== null && value) {
36-
ref.current.value = value;
35+
const qParam = searchParams.get('q') || '';
36+
if (ref.current !== null) {
37+
ref.current.value = qParam;
3738
}
38-
}, [value]);
39+
}, [searchParams]);
3940

4041
const handleChange = useDebouncedCallback((e) => {
4142
if (ref.current != null) {

0 commit comments

Comments
 (0)