Skip to content

Commit

Permalink
scroll to top when clicking an other product in /product
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghy2130 committed Oct 10, 2024
1 parent 96bcf4a commit bd6b53c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default function OtherProductCard({ product }: Props) {
<Link
to={`/product/${product.id}`}
className="flex h-full w-full flex-col overflow-hidden rounded-lg bg-bgColor2 shadow-md sm:rounded-xl"
onClick={() => {
window.scrollTo({ top: 0, behavior: "smooth" });
}}
>
<div className="relative flex aspect-square w-full cursor-pointer items-center justify-center">
{imgName === null ? (
Expand Down

0 comments on commit bd6b53c

Please sign in to comment.