-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Get Field Component via refs #141
Comments
also having the same issue |
You can use a simple func to render your component like:
|
Would be nice to have the official Forwarding Refs API implemented in each component to pass down the reference. |
Yes, this is a must-have. I was very surprised when I tried adding a Shouldn't be too hard to add this... Take a look at material-ui, for example. They wrap pretty much everything in a To do:
For what it's worth, here's the workaround I'm using (similar to @ibratoev's but using inline component so you don't have to come up externally create and name a wrapper component for each input component you're using): Change: component="input" to: component={props => <input {...props} ref={inputEl} />} (Working demo here: https://codesandbox.io/s/react-final-form-how-to-get-ref-ekc6m) |
I am using react-native and react-final-form and this is kind of deal breaker not to have the forward ref, because I can't solve the UX requirement as follow: https://stackoverflow.com/questions/32748718/react-native-how-to-select-the-next-textinput-after-pressing-the-next-keyboar Any update on this ? |
Hi and thanks @erikras for taking care of it, this could remain open till we can test it on our end don't you think? |
Published fix in |
Are you submitting a bug report or a feature request?
feature request
What is the current behavior?
There is no a way to get Field components via refs.
What is the expected behavior?
Access to the rendered component in a Field
<Field {....} component={MyCustomField} />
.What's your environment?
Other information
I am using this library in a React Native App, so the behavior that I would like to implement is this: Focus a field when clicking on "Next" key in the virtual keyboard on iOS.
The text was updated successfully, but these errors were encountered: