input autofocus attribute is not working
See original GitHub issueHi,
I have this input field that I use with typeahead. It has an autofocus attribute that instructs the browser to focus on it. That worked before adding typeahead. After adding typeahead, that is no longer working.
<input autofocus="autofocus" class="string required span6"
data-behavior="typeahead"
data-typeahead="products" id="payment_detail" name="payment[detail]"
size="50" type="text">
Issue Analytics
- State:
- Created 10 years ago
- Comments:5
Top Results From Across the Web
Auto focus is not working for input field - Stack Overflow
Autofocus attribute moves the focus to the specified input on page load. In this case #input is present in DOM but hidden; on...
Read more >Fixing the auto-focus - HTML Form Guide
Correcting the auto-focus One way to avoid the troubles with the wrong auto-focus is to avoid auto focus if the user has already...
Read more >Autofocus attribute doesn't work reliably · Issue #186 · elm/html
autofocus is defined to work reliably only on page load. It is not really suited for situations where you are swapping, or opening,...
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 >HTML input autofocus Attribute - W3Schools
The autofocus attribute is a boolean attribute. When present, it specifies that an <input> element should automatically get focus when the page loads....
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 FreeTop 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
Top GitHub Comments
It seems like typeahead.js should respect the autofocus attribute but you can trigger the focus event off the instantiation:
@toddmo I don’t think this project is maintained anymore, see #1618