diff --git a/src/components/media-modal.jsx b/src/components/media-modal.jsx index 721b6ef6..30584c08 100644 --- a/src/components/media-modal.jsx +++ b/src/components/media-modal.jsx @@ -246,8 +246,10 @@ function MediaModal({ behavior: 'smooth', }); setTimeout(() => { - carouselRef.current.focus(); - }, 100); + // Delay is needed for Safari, the focus stops it from scrolling + // 1000 is hypothetical + carouselRef.current?.focus(); + }, 1000); }} > @@ -264,8 +266,10 @@ function MediaModal({ behavior: 'smooth', }); setTimeout(() => { - carouselRef.current.focus(); - }, 100); + // Delay is needed for Safari, the focus stops it from scrolling + // 1000 is hypothetical + carouselRef.current?.focus(); + }, 1000); }} >