Make ModeSwitch Dropdown focus aware

This commit is contained in:
nocnico
2025-06-03 21:16:36 +02:00
parent e191618483
commit 4602f90652

View File

@@ -8,12 +8,15 @@ export default function ModeSwitchDropdown() {
const path = usePathname(); const path = usePathname();
return ( return (
<details className="dropdown z-[9999]"> <div className="dropdown z-[9999]">
<summary className="btn m-1"> <div tabIndex={0} role="button" className="btn m-1">
<ArrowLeftRight /> {path.includes("pilot") && "Pilot"} <ArrowLeftRight /> {path.includes("pilot") && "Pilot"}
{path.includes("dispatch") && "Leitstelle"} {path.includes("dispatch") && "Leitstelle"}
</summary> </div>
<ul className="menu dropdown-content bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm"> <ul
tabIndex={0}
className="menu dropdown-content bg-base-100 rounded-box z-1 w-52 p-2 shadow-sm"
>
<li> <li>
<Link href={"/dispatch"}> <Link href={"/dispatch"}>
<Workflow /> Leitstelle <Workflow /> Leitstelle
@@ -25,6 +28,6 @@ export default function ModeSwitchDropdown() {
</Link> </Link>
</li> </li>
</ul> </ul>
</details> </div>
); );
} }