final-form / final-form-focus

🏁 Final Form "decorator" that will attempt to apply focus to the first field with an error upon an attempted form submission
MIT License
83 stars 15 forks source link

After reseting form decorator focuses first invalid field. #14

Open ArtyomResh opened 5 years ago

ArtyomResh commented 5 years ago

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?

Soundvessel commented 5 years ago

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 commented 3 years ago

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