1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-17 22:51:16 +02:00

Keyboard Navigation only on vissible elements

This commit is contained in:
Deepak Mardi
2024-03-31 23:05:15 +05:30
parent d4eef5ecd0
commit dbdfb2226b

View File

@@ -71,12 +71,10 @@ export function NavigationDropdown() {
>
<Menu className="h-5 w-5" />
</button>
{isOpen && (
<div
className={cn(
'absolute pointer-events-none left-0 top-full z-[999] mt-2 w-48 min-w-[320px] -translate-y-1 rounded-lg bg-slate-800 py-2 opacity-0 shadow-xl transition-all duration-100',
{
'pointer-events-auto translate-y-2.5 opacity-100': isOpen,
},
'pointer-events-auto absolute left-0 top-full z-[999] mt-2 w-48 min-w-[320px] translate-y-2.5 rounded-lg bg-slate-800 py-2 opacity-100 shadow-xl transition-all duration-100',
)}
>
{links.map((link) => (
@@ -99,6 +97,7 @@ export function NavigationDropdown() {
</a>
))}
</div>
)}
</div>
);
}