Fix carousel bug: focus first then scroll

This commit is contained in:
Lim Chee Aun 2024-10-27 20:40:52 +08:00
parent 5be052dd4d
commit d246e45be6

View file

@ -260,8 +260,8 @@ function MediaModal({
e.stopPropagation(); e.stopPropagation();
const left = const left =
carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1); carouselRef.current.clientWidth * i * (isRTL() ? -1 : 1);
carouselRef.current.scrollTo({ left, behavior: 'smooth' });
carouselRef.current.focus(); carouselRef.current.focus();
carouselRef.current.scrollTo({ left, behavior: 'smooth' });
}} }}
> >
<Icon icon="round" size="s" alt="⸱" /> <Icon icon="round" size="s" alt="⸱" />