-
I have a form element inside a popover. After searching in the docs https://www.radix-ui.com/docs/primitives/components/popover#keyboard-interactions I notice this is the expected popover behavior to close on enter I end up doing something like:
Thank! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @nirtamir2,
I don't think it does. If you look at the demo on the docs, it doesn't do that. If you are seeing something else, could you link up a codesandbox with your issue? |
Beta Was this translation helpful? Give feedback.
-
@benoitgrelard thank you for your help. |
Beta Was this translation helpful? Give feedback.
@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).