final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.39k stars 481 forks source link

Any docs about forcing focus on a given field? #407

Open FernandoBasso opened 5 years ago

FernandoBasso commented 5 years ago

Is there any piece of doc or tip that shows or explains some way to focus on a specific field? For instance, after a user types two digits on a field, automatically focus on the next field?

taneba commented 5 years ago

@FernandoBasso You can use React.createRef() to implement that behavior.

Here's my naive implementation (When you type two strings on the FirstName field, then automatically focus on the next field) : https://codesandbox.io/s/24mm7j7wny

rendomnet commented 5 years ago

@taneba example is empty