feat: enable tab navigation through carousel previews, replacing arrow buttons

This commit is contained in:
cj-do-gta-sander 2024-10-24 14:27:54 -03:00
parent bf6ce2b465
commit c754710171

View file

@ -140,7 +140,7 @@ export function GallerySlider() {
direction: "left", direction: "left",
})} })}
aria-label={t("previous_screenshot")} aria-label={t("previous_screenshot")}
tabIndex={0} tabIndex={-1}
> >
<ChevronLeftIcon size={36} /> <ChevronLeftIcon size={36} />
</button> </button>
@ -153,7 +153,7 @@ export function GallerySlider() {
direction: "right", direction: "right",
})} })}
aria-label={t("next_screenshot")} aria-label={t("next_screenshot")}
tabIndex={0} tabIndex={-1}
> >
<ChevronRightIcon size={36} /> <ChevronRightIcon size={36} />
</button> </button>
@ -169,6 +169,7 @@ export function GallerySlider() {
})} })}
onClick={() => setMediaIndex(i)} onClick={() => setMediaIndex(i)}
aria-label={t("open_screenshot", { number: i + 1 })} aria-label={t("open_screenshot", { number: i + 1 })}
onFocus={() => setMediaIndex(i)}
> >
<img <img
src={media.thumbnail} src={media.thumbnail}