Using autocomplete.js as InstantSearch.js searchbox
See original GitHub issuecopy of https://github.com/algolia/autocomplete.js/issues/216 by @SchmidtDawid
Hi i want to implement autocomplete but i can’t make it work with instantsearch. When i have 2 inputs - one is for searchBox widget and the second is for autocomplete, everything works great (but of course autocomplete doesn’t have impact on hits). But when autocomplete and searchbox pointing on same input i have an error.
Uncaught TypeError: Cannot read property 'style' of null
at search-box.js:130
at Object.render (connectSearchBox.js:136)
at InstantSearch.js:317
at n (_arrayEach.js:15)
at r (forEach.js:37)
at t.value (InstantSearch.js:313)
at r.n.emit (events.js:84)
at algoliasearch.helper.js:1245
at n (_arrayEach.js:15)
at r (forEach.js:37)
error pointing on this line: resetButton.style.display = query && query.trim() ? 'block' : 'none';
.
This is my script list:
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.3/dist/instantsearch.min.js"></script>
<script src="/js/algolia_search.js"></script>
<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script>
<script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js"></script>
I tried every possible configuration, but is doesn’t matter.
I don’t have idea how to solve it. Can you help?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Integrate Autocomplete with InstantSearch.js - Algolia
Learn how to use Autocomplete with InstantSearch.js. ... This autocomplete can work as a rich search box in a search page, and a...
Read more >Algolia JavaScript call the search for autocomplete
I am making a search for paintings and using the algolia api, instantsearch and autocomplete.js. I have added the autocomplete but the ...
Read more >autocomplete as searchbox - CodeSandbox
Forked Fromautocomplete as searchbox; Environmentparcel. Files .editorconfig .eslintrc.js .gitignore .nvmrc. autocompleteWidget.js. index.css. index.html.
Read more >Trigger user interactions directly from your search box with ...
The topic of this new Live Coding Session is " Autocomplete Omnibar ... through setting up Autocomplete to fire interactions with JavaScript.
Read more >Instant search - npm.io
Adapter to use InstantSearch UI widgets with Typesense Search ... Searchbx API Client for JavaScript with instant search experiences.
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
Yes we write comments almost in same time. I’ll try your solution tomorrow because in my solution selecting autocomplete items by arrows doesn’t change input value.
Awesome!