Open tarngerine opened 1 year ago
You can use an anchor
tag inside Command.Item
https://codesandbox.io/s/silly-solomon-mthm2w?file=/src/App.tsx
@joaom00 thanks for chiming in, but this doesnt support the standard onSelect keyboard behavior (navigate on return)
best way i'm hacking it is to add an anchor tag inside, but also keep onSelect on the CommandItem. however, the anchor tag needs to have its own click handler that e.stopPropagation to prevent double firing (in the case where you have side effects from onSelect, which I do)
Ohh I see, yeah I think your approach is the way to go for now. I guess if #138 gets merged you will be able to have the desired behavior. Would be like this:
<Command.Item asChild>
<a />
</Command.Item>
we have some items that are links, whats the recommended approach to support middle clicking? i could imagine onSelect handler passing the event