mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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(() => {
|
useEffect(() => {
|
||||||
if (pageInput.current) pageInput.current.value = `${page + 1}`;
|
if (pageInput.current) pageInput.current.value = `${page + 1}`;
|
||||||
}, [page]);
|
}, [page]);
|
||||||
|
useEffect(() => {
|
||||||
|
setPage(
|
||||||
|
Math.min(
|
||||||
|
Math.max(0, page),
|
||||||
|
Math.ceil(searchedList.length / TANKS_PER_PAGE) - 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}, [searchedList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper size="wide">
|
<PageWrapper size="wide">
|
||||||
|
|||||||
Reference in new issue
Block a user