Unable to autofocus searchbox
See original GitHub issueDescribe the bug 🐛
AIS searchbox is not autofocused even when autofocus input is set to true. See code below:
<ais-search-box [autofocus]='true' placeholder="Search"></ais-search-box>
I’ve read through PR #208 and this seems to add the autofocus feature. Maybe I’m not implementing it correctly?
To Reproduce 🔍
Steps to reproduce the behavior:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
A live example helps a lot! We have a simple online template for you to use for your explanations:
Expected behavior 💭
A clear and concise description of what you expected to happen.
Screenshots 🖥
If applicable, add screenshots to help explain your problem.
Environment:
- OS: mac (10.14.2)
- Browser: Chrome
- Version 71.0.3578.98
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Auto Focus Property is not working in Text Input Component ...
I am making a Search Bar and I want they keyboard to open up once the Search button has been clicked however the...
Read more >Why would the search input field not get focus when the page ...
I'm on Windows. It occurs to me it might be functionality that's added by an extension. Either way, it get's broken if you...
Read more >searchBox | InstantSearch.js - Algolia
The searchBox widget is used to let the user perform a text-based query. This usually is the main entry point to start the...
Read more >Auto-focusing into the search box (U29.5) - Art, Animation, & UI
i have been waiting for Search Box autofocus to be fixed for like, 3, maybe 5 years. the solution, is for entering the...
Read more >Set Input Focus with HTML5 autofocus | SamanthaMing.com
Note you can't apply autofocus on inputs of type hidden because hidden inputs can't be focused. ... Also, autofocus can only be on...
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
@tkrugg nothing on Algolia’s side. The issue was tracked down to this bit of code in our index.html:
Seems like somehow our fonts loading removes focus on the search input. I’ve resolved by moving this down the page. Thanks again to @samouss for taking the time to help.
I’ve tracked this back to the usage of Google Tag Manager. When I remove our tag manager script from
index.html
suddenly autofocus works 🤷♀️. Not sure what script exactly but will continue to debug.