Skip to content
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

Question: How to focus on a specific field after submitting? #68

Closed
serkandurusoy opened this issue Jul 12, 2016 · 6 comments
Closed

Question: How to focus on a specific field after submitting? #68

serkandurusoy opened this issue Jul 12, 2016 · 6 comments
Assignees
Labels
Type: Question Questions and other discussions

Comments

@serkandurusoy
Copy link
Contributor

I want to be able to focus on a specific field on a form after the form submit has been handled, but could not manage to get a reference to the input of a field component I want to target.

Tried to track down some API for that but could not find one, so what would be the canonical way to get a reference for an input?

@radekmie radekmie self-assigned this Jul 12, 2016
@radekmie
Copy link
Contributor

Well, there's no such API, because there don't have to be any input - take the HiddenField (with noDOM prop) as an example. Or a custom field with 2 inputs. What then?

@radekmie radekmie added the Type: Question Questions and other discussions label Jul 12, 2016
@serkandurusoy
Copy link
Contributor Author

serkandurusoy commented Jul 12, 2016 via email

@radekmie
Copy link
Contributor

Okay, so some fields like TextField or NumField could pass own ref prop to proper input. That should be enough, isn't it?

@serkandurusoy
Copy link
Contributor Author

Sure, definitely. In fact, that's how I solved my immediate problem.

The only gotcha is you cannot name that property as refbecause it is
reserved.

On Wed, Jul 13, 2016 at 12:36 PM, Radosław Miernik <notifications@github.com

wrote:

Okay, so some fields like TextField or NumField could pass own ref prop
to proper input. That should be enough, isn't it?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#68 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AEbz3NlllKZ4UuzoGVacNZQ2ZMu-TzGDks5qVLGygaJpZM4JKoff
.

@radekmie
Copy link
Contributor

Okay, any idea, how to call it? How about inputRef?

@serkandurusoy
Copy link
Contributor Author

serkandurusoy commented Jul 15, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Questions and other discussions
Projects
Archived in project
Development

No branches or pull requests

2 participants