Skip to content

Opt out Popover close on Enter key behavior #1685

Answered by nirtamir2
nirtamir2 asked this question in Help
Discussion options

You must be logged in to vote

@benoitgrelard thank you for your help.
I fixed the problem - it has nothing related to radix-ui.
If you are interested - I have a form with cancel button and submit button and the cancel button did not have a type attribute.
So when I clicked Enter key on the input - the browser clicked the cancel button it instead of the submit button so it closed the popover. I added a reproduction here codesandbox.io/s/frosty-tristan-f98fud?file=/src/App.tsx with the problem and solution (form with button without type attribute).

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@benoitgrelard
Comment options

Answer selected by nirtamir2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants