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

Field is incorrectly focussed when using Wizard #34

Open RyanxWolton opened 2 years ago

RyanxWolton commented 2 years ago

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

When using a Wizard form with final-form-focus, similar to the react final form docs example, linked in the sandbox below, when submitting one page of the form, the first required input on the next page is focussed, even though no error is displayed, this also means the error is then displayed on any click causing blur of the input

What is the expected behavior?

Inputs are only focussed on each page after clicking 'Next' or 'Submit'

Sandbox Link

https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/wizard?file=/Wizard.js:1831-1835

What's your environment?

final-form-focus: 1.1.2 final-form: 4.19.1 react-final-form: 6.4.0 browser: Firefox Developer Edition node version: 12.13.0

Other information