From fe8eb742420671576424524ccbd0395a7bc52869 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 14 Aug 2023 21:09:14 +0800 Subject: [PATCH] Another attempt --- src/components/media-modal.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/media-modal.jsx b/src/components/media-modal.jsx index 77980f80..721b6ef6 100644 --- a/src/components/media-modal.jsx +++ b/src/components/media-modal.jsx @@ -245,7 +245,9 @@ function MediaModal({ left: carouselRef.current.clientWidth * (currentIndex - 1), behavior: 'smooth', }); - carouselRef.current.focus(); + setTimeout(() => { + carouselRef.current.focus(); + }, 100); }} > @@ -261,7 +263,9 @@ function MediaModal({ left: carouselRef.current.clientWidth * (currentIndex + 1), behavior: 'smooth', }); - carouselRef.current.focus(); + setTimeout(() => { + carouselRef.current.focus(); + }, 100); }} >