From 9f8a41ea7bc08d99b137789f9a0b870e824135de Mon Sep 17 00:00:00 2001 From: Samandar Turgunboyev Date: Wed, 25 Feb 2026 13:31:42 +0500 Subject: [PATCH] bug fixed --- src/features/category/ui/AllProduct.tsx | 4 ++++ src/features/category/ui/Product.tsx | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/features/category/ui/AllProduct.tsx b/src/features/category/ui/AllProduct.tsx index 3da3e6e..080b4a7 100644 --- a/src/features/category/ui/AllProduct.tsx +++ b/src/features/category/ui/AllProduct.tsx @@ -54,6 +54,10 @@ const AllProducts = () => { router.push(`${pathname}?${params.toString()}`); }; + useEffect(() => { + window.scrollTo({ top: 0, behavior: 'smooth' }); + }, [page]); + return (
diff --git a/src/features/category/ui/Product.tsx b/src/features/category/ui/Product.tsx index c99889d..d61f571 100644 --- a/src/features/category/ui/Product.tsx +++ b/src/features/category/ui/Product.tsx @@ -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 (