summaryrefslogtreecommitdiff
path: root/src-migrate/modules/product-detail/components/ProductDetail.tsx
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-23 14:48:48 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2025-12-23 14:48:48 +0700
commitddc308aa4e5da482763f97e16ab92fe777e8dfeb (patch)
tree8288808475915aaffcdeede4868984a4e30124da /src-migrate/modules/product-detail/components/ProductDetail.tsx
parentfbbff6a25ed39b721927a79ce905f4d1e06e522b (diff)
(andri) fix scrolltoindexmagento-v1
Diffstat (limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx')
-rw-r--r--src-migrate/modules/product-detail/components/ProductDetail.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx
index 1c9c39e0..82b99697 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -312,10 +312,9 @@ const ProductDetail = ({ product }: Props) => {
};
const scrollToIndex = (i: number) => {
- const el = sliderRef.current;
- if (!el) return;
- const elRef = sliderRef.current;
- elRef.scrollTo({ left: i * elRef.clientWidth, behavior: 'smooth' });
+ const el = sliderRef.current;
+ if (!el) return;
+ el.scrollTo({ left: i * el.clientWidth, behavior: 'smooth' });
setCurrentIdx(i);
setMainImage(allImages[i] || '');
};