question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ericgiocommented, Feb 8, 2017

@rpedela: You should be able to use the existing methods for that.

0reactions
sahilvicesoftwarecommented, May 9, 2019

@rpedela: You should be able to use the existing methods for that.

is this example available now?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found