-
Notifications
You must be signed in to change notification settings - Fork 58
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
Suggested approach for focussing inputs after render #23
Comments
You should use findDomNode() |
My understanding is that the use of this method is not recommended. It also doesn't appear to work in preact. Perhaps for these cases it will be easier just to provide the input box manually. |
I think this is a preact problem, not this library. Why you do not want to use findDomNode? We could introduce a new props "inputRef", but this does not seem to me to be the right decision. |
It looks like Given that |
Is there a suggested approach for focussing input fields when a component is rendered? The
autoFocus
parameter works on a page refresh, but not when replacing the current contents.The following approach does not work as the ref is associated with the
Input
class instance as opposed to the renderedinput
tag, and thefocus()
call is not forwarded:I'm quite new to React, so maybe I'm missing something.
Thanks.
The text was updated successfully, but these errors were encountered: