Closed nik-lampe closed 6 years ago
I'd love to see a PR. 👍
Update the README, too, please.
Done. This is my first PR ever, so I'd love feedback if I made any mistakes. 🙂
@nik-lampe, would you mind giving an example on how to implement passing in GetInputs and FindInput?
@nik-lampe Hello, I don't know if I use the select component, how to make the interface slide to the corresponding position when the validation fails. Can you tell me how to use findInput? Can it fulfill my needs? PS: It is best to have a demo demo, thank you very much.
Hey,
sure here is a fork of the original codesandbox example:
https://codesandbox.io/s/react-final-form-focus-on-first-error-egxcq
Hope this helps
Are you submitting a bug report or a feature request?
Feature Request
What is the current behavior?
I am using custom components in my form (react-select components in this case). They don'r render any input components, so they aren't found with the findInput method that is currently implemented.
What is the expected behavior?
I suggest adding an optional parameter to the createDecorator function, which is used to find the input if provided. Just like the getInputs parameter.
What's your environment?
final-form: "^4.8.3", react-final-form: "^3.3.1", Chrome Version 67.0.3396.99 on MacOS 10.13.6 node v10.7.0
Other information
I have forked this and implemented it for my own use. I can create a PR out of it, if needed. But it's only a very simple change.
https://github.com/nik-lampe/final-form-focus/tree/feature/find-input