Focus search provider button with tab key

This commit is contained in:
Flo2410 2024-02-08 22:37:42 +00:00
parent fb9818e1fc
commit ffad5d247e
No known key found for this signature in database
GPG Key ID: 8ECB00AC5216DC7F

View File

@ -124,6 +124,7 @@ export default function Search({ options }) {
event.key === "Tab" &&
document.getElementById("comboboxOptions")?.getAttribute("data-headlessui-state") === "open"
) {
document.getElementById("searchProviderButton").focus();
event.preventDefault();
}
};
@ -193,6 +194,7 @@ export default function Search({ options }) {
text-white font-medium text-sm
bg-theme-600/40 dark:bg-white/10
focus:ring-theme-500 dark:focus:ring-white/50"
id="searchProviderButton"
>
<selectedProvider.icon className="text-white w-3 h-3" />
<span className="sr-only">{t("search.search")}</span>