[Help] Enter Key closes modal #1660
-
I am trying to create a modal with a form inside it Help WantedFunctionality I want to make:
According to Modal docs if a false is passed back to onApprove, then the modal should not hide. If I open the modal, and press the enter key, the modal closes. Testcase |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The Browsers impement their own logic when pressing the enter key inside a form and trigger the submit by themselves if there is at least one submit button. By default each We had a similar question at #1632 |
Beta Was this translation helpful? Give feedback.
-
That makes alot of sense! Thanks @lubber-de ! |
Beta Was this translation helpful? Give feedback.
The Browsers impement their own logic when pressing the enter key inside a form and trigger the submit by themselves if there is at least one submit button. By default each
<button>
is a submit button.Your
keyboardShortcuts: false
approach was quite right, however to also prevent the browsers default logic, usediv
buttons insteadSee https://jsfiddle.net/lubber/hajkt2rb/13/
We had a similar question at #1632