mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
fix: page readjusting on search
This commit is contained in:
1 parent
c5e1a7d6ab
commit
20c839394a
1 file changed
+8
@@ -45,6 +45,14 @@ export default function Page() {
|
||||
useEffect(() => {
|
||||
if (pageInput.current) pageInput.current.value = `${page + 1}`;
|
||||
}, [page]);
|
||||
useEffect(() => {
|
||||
setPage(
|
||||
Math.min(
|
||||
Math.max(0, page),
|
||||
Math.ceil(searchedList.length / TANKS_PER_PAGE) - 1,
|
||||
),
|
||||
);
|
||||
}, [searchedList]);
|
||||
|
||||
return (
|
||||
<PageWrapper size="wide">
|
||||
|
||||
Reference in new issue
Block a user