Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use final-form-focus without using <form> tag? #15

Open
marrkeri opened this issue Oct 25, 2019 · 1 comment
Open

Comments

@marrkeri
Copy link

marrkeri commented Oct 25, 2019

Check this demo: https://codesandbox.io/s/react-final-form-focus-on-first-error-ib23b

If you avoid <form> tag and you use just
<button onClick={form.submit} disabled={submitting}>Submit</button>, validation is provided but focus is not there.

Problem with <form onSubmit={handleSubmit} /> is that, that even Enter on textbox will trigger it or even worse every other button without specifying type="".
It would be also helpful to have it without <form> tag

@marrkeri
Copy link
Author

marrkeri commented Oct 25, 2019

In this link I have been fighting with with onSubmit on <form> so at least for now it will help to others https://stackoverflow.com/questions/58560978/form-onsubmit-handlesubmit-is-triggered-through-any-button-which-has-type-sub/58561557#58561557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant