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

2 form on page, focus working incorrect #8

Open
DragorWW opened this issue Apr 30, 2019 · 4 comments
Open

2 form on page, focus working incorrect #8

DragorWW opened this issue Apr 30, 2019 · 4 comments

Comments

@DragorWW
Copy link

example: https://codesandbox.io/s/818ov6pok0

case:

  • submit last form

What is the current behavior?

input in first form get focus

What is the expected behavior?

input in last form get focus

@tylim88
Copy link

tylim88 commented May 21, 2019

having the same issue, but mine is only one form

it focuses on the error that you focus last, it seems your example also has similar behavior

tylim88 added a commit to zero-to-mastery/GameSenshi that referenced this issue May 21, 2019
@ArtyomResh
Copy link

ArtyomResh commented May 29, 2019

That happens because createDecorator search invalid input with specific name in all forms:

and focuses on first its get:

Use getFormInputs to search for invalid input only in specific form, here is example:
https://codesandbox.io/embed/react-final-form-focus-on-first-error-hvzhm

@Yankovsky
Copy link

@DragorWW @tylim88 ^

ArtyomResh added a commit to ArtyomResh/final-form-focus that referenced this issue May 29, 2019
The description leads to misunderstanding about how this decorator works: final-form#8
@ArtyomResh
Copy link

ArtyomResh commented Dec 12, 2019

@erikras Hi! Can you please approve my PR, that corrects this misconception in the documentation?

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

4 participants