You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like an option can be selected with a right click also, I want to prevent this behaviour, i.e. only select an option using left click.
Since the documentation doesn't talk much about these events, can anyone help me with how can I achieve it ?
The text was updated successfully, but these errors were encountered:
shirshendubhowmick
changed the title
How to prevent selecting element from Redix Select on right click
How to prevent selecting option of Radix Select on right click
Jan 15, 2025
html elements have an event handler called onContextMenu. I haven't tested it, but you could likely pass a function to it that calls e.preventPropagation() or e.preventDefault().
That seems a bit trickier since Radix strictly follows browser standards. With a standard HTML <select> menu, right-clicking selects an option instead of opening the context menu—that's the default browser behavior.
What's the reason you're looking for this behavior?
With the Redix Select demo here:
https://www.radix-ui.com/primitives/docs/components/select
It looks like an option can be selected with a right click also, I want to prevent this behaviour, i.e. only select an option using left click.
Since the documentation doesn't talk much about these events, can anyone help me with how can I achieve it ?
The text was updated successfully, but these errors were encountered: