Only one Field exists, press 'enter' trigger submit
See original GitHub issuefor example,
<form className={styles.wrapper} onSubmit={handleSubmit(this.handleSubmit)}>
<Field ............................................. >
</form>
tag, press ‘enter’ resulting execute this.handleSubmit but when more than one Field component exist, press ‘enter’ not fire this.handleSubmit
is it possible disable ‘enter’ for submit when one Field exists?
i saw the same issue, but can’t find answer
- i’m using redux-form 6.5.0 version
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Trigger a button click with JavaScript on the Enter key in a text ...
A page can have many forms (but not nested), each having their own submit. Every field of each form will trigger only the...
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 >It is not able to submit form by typing enter key on text field.
I found bug. If activeform doesnt content the submit button, it is not able to submit form by typing enter key on text...
Read more >Form Validation with JavaScript
Let's build a simple form with a validation script. The form will include one text field called “Your Name”, and a submit button....
Read more >How to trigger 'enter' event without pressing enter
How to trigger an 'Enter' event programatically in the backend without pressing enter on the screen but maybe after the user fills in...
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 FreeTop 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
Top GitHub Comments
@highalps One way to disable submitting the
form
on enter and instead have changes to the field trigger the submit is as follows:Then, the
Field
can useonChange
to submit data. I recommend adding the no-op empty function tohandleSubmit
in case the form uses theonSubmit
prop to trigger actions.@highalps I believe you can put a hidden
<button>
😃