Allow keyboard nav after clicking on buttons in media carousel

This commit is contained in:
Lim Chee Aun 2023-08-01 19:43:52 +08:00
parent 75cfd02134
commit b0ed0be47d

View file

@ -176,6 +176,7 @@ function MediaModal({
left: carouselRef.current.clientWidth * i,
behavior: 'smooth',
});
carouselRef.current.focus();
}}
>
•
@ -245,6 +246,7 @@ function MediaModal({
left: carouselRef.current.clientWidth * (currentIndex - 1),
behavior: 'smooth',
});
carouselRef.current.focus();
}}
>
<Icon icon="arrow-left" />
@ -260,6 +262,7 @@ function MediaModal({
left: carouselRef.current.clientWidth * (currentIndex + 1),
behavior: 'smooth',
});
carouselRef.current.focus();
}}
>
<Icon icon="arrow-right" />
@ -272,6 +275,7 @@ function MediaModal({
onClick={(e) => {
if (e.target === e.currentTarget) {
setShowMediaAlt(false);
carouselRef.current.focus();
}
}}
>