From d246e45be6d17aa8cfdc2200596c826d0f04c1f7 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 27 Oct 2024 20:40:52 +0800 Subject: [PATCH] Fix carousel bug: focus first then scroll --- src/components/media-modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/media-modal.jsx b/src/components/media-modal.jsx index dfdcbd64..b254b6df 100644 --- a/src/components/media-modal.jsx +++ b/src/components/media-modal.jsx @@ -260,8 +260,8 @@ function MediaModal({ e.stopPropagation(); const left = carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1); - carouselRef.current.scrollTo({ left, behavior: 'smooth' }); carouselRef.current.focus(); + carouselRef.current.scrollTo({ left, behavior: 'smooth' }); }} >