Allow autoFocus prop
See original GitHub issue… to set focus on the input element.
This is how I solved it now:
componentDidUpdate() {
if (this.props.auto_focus) {
this.refs.typeahead.getInstance().focus();
}
}
Maybe that is enough?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
3 ways to autofocus an input in React that ALMOST always work!
The simplest method involves using the autoFocus prop on input elements (Notice the uppercase F). It's similar to (but also very different from) ......
Read more >How to autofocus using React Hooks - LogRocket Blog
There are a few ways to autofocus a React input field. The autoFocus prop. You can use the autoFocus prop. const ...
Read more >autofocus - HTML: HyperText Markup Language | MDN
The autofocus global attribute is a Boolean attribute indicating that an element should be focused on page load, or when the <dialog> that...
Read more >AutoFocus an input element in react JS - Stack Overflow
The DOM can be accessed in this method, enabling to define DOM manipulations or data fetching operations. Any DOM interactions should always happen...
Read more >HTML input autofocus Attribute - W3Schools
Let the "First name" input field automatically get focus when the page loads: <form action="/action_page.php"> <label for="fname">First name:</label>
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rpedela: You should be able to use the existing methods for that.
is this example available now?