bug fixed

This commit is contained in:
Samandar Turgunboyev
2026-02-25 13:31:42 +05:00
parent 4d35b8f6d1
commit 9f8a41ea7b
2 changed files with 9 additions and 3 deletions

View File

@@ -54,6 +54,10 @@ const AllProducts = () => {
router.push(`${pathname}?${params.toString()}`);
};
useEffect(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
}, [page]);
return (
<div className="custom-container p-4 mb-5 flex flex-col min-h-[calc(85vh)]">
<div className="flex-1">

View File

@@ -60,11 +60,13 @@ const Product = () => {
const params = new URLSearchParams(searchParams.toString());
params.set('page', newPage.toString());
router.push(`${pathname}?${params.toString()}`, {
scroll: true,
});
router.push(`${pathname}?${params.toString()}`);
};
useEffect(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
}, [page]);
return (
<div className="custom-container p-4 mb-5 flex flex-col min-h-[85vh]">
<div className="flex-1">