Way to disable the submit event triggered by pressing the enter key while focusing an input field
See original GitHub issueHi folks, let’s say I have a Formsy-React Form
and when the use typing down the characters, the submit
event can be triggered by pressing the <kbd>Enter</kbd> button.
Is there a way to disable this functionality?
I understand this is a feature for form
element(Trigger by pressing the <kbd>Enter</kbd> button). And I don’t want to bind events to each input fields, that doesn’t make sense, especially when you have lots of inputs and other elements.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Prevent users from submitting a form by hitting Enter
This method is unideal because it prevents the user from submitting the form by pressing enter while focused on the submit button. The...
Read more >How to disable form submit on enter button using jQuery
There are two methods to submit a form,. Using the “enter” key: When the user press the “enter” key from the keyboard then...
Read more >The Enter Key should Submit Forms, Stop Suppressing it
Basically, if the user hits enter when a text field is focused, the browser should find the first submit button in the form...
Read more >React disable submit event triggered by pressing enter key
Sometimes I want to disable the submit event triggered by pressing the enter key while focusing an input field.
Read more >ARIA: button role - Accessibility - MDN Web Docs
The button role is for clickable elements that trigger a response when ... give the text field focus to enable entering and additional...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Semigradsky Nice suggestion. It also requires extra caution when you have text-area element in the form. Can be fixed with: