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

After reseting form decorator focuses first invalid field. #14

Open
ArtyomResh opened this issue Aug 19, 2019 · 2 comments
Open

After reseting form decorator focuses first invalid field. #14

ArtyomResh opened this issue Aug 19, 2019 · 2 comments

Comments

@ArtyomResh
Copy link

ArtyomResh commented Aug 19, 2019

Hello! I'm

What is the current behavior?

I use the FormSpy component to watch the submitSucceeded event. If this event occurs, I do this.props.form.reset(). The form's values are updated, and then the first invalid field gets into focus.

What is the expected behavior?

No focus on reset.

Sandbox Link

Example

What's your environment?

  • final-form": "^4.18.4",
  • final-form-focus": "^1.1.2",
  • node: v8.15.1
  • MacOS Mojave
  • Any browser
@Soundvessel
Copy link

Check out the API for form.initalize which is what I think you will want instead. The nice thing about that is that it will keep your submitSucceeded state so in my case, a success alert message, doesn't disappear.

@vkosinov
Copy link

Unfortunately form.initalize does not help, the problem is still relevant.

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

3 participants