fix(nav): product-switch dropdown reageert weer op klik

Base UI's Menu.Item vuurt geen React-onSelect af bij activatie; alleen
onClick werkt. handleSwitchProduct werd daardoor nooit aangeroepen.
user-menu.tsx en sprint-backlog.tsx gebruiken al onClick — NavBar
miste deze workaround.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-04 06:53:12 +02:00
parent b47f62966e
commit 2aa3bc463f

View file

@ -163,7 +163,7 @@ export function NavBar({
{products.map(p => ( {products.map(p => (
<DropdownMenuItem <DropdownMenuItem
key={p.id} key={p.id}
onSelect={() => p.id !== activeProduct.id && handleSwitchProduct(p.id)} onClick={() => p.id !== activeProduct.id && handleSwitchProduct(p.id)}
className={cn( className={cn(
p.id === activeProduct.id && 'bg-primary-container text-primary-container-foreground font-medium' p.id === activeProduct.id && 'bg-primary-container text-primary-container-foreground font-medium'
)} )}