[searchBox]: queryHook not called on initial search
See original GitHub issueCurrently the queryHook
parameter to the searchBox
widget is not called on the initial search (the one we usually refer to the “empty query”).
This seems broken because it is correctly fired if I start typing something then delete everything (in essence getting back to the “empty query”).
I’m not sure if this is a bug or if it is by design, tough.
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
searchBox | InstantSearch.js - Algolia
If the search method is not called, no search is made to Algolia and the UI doesn't refresh. If the search method is...
Read more >algolia search box: how to add filters within searchbox
To do that, you'll customize the searchBox widget with the queryHook parameter. In the query hook, you can add the aroundLatLng parameter to ......
Read more >Search Bar in React Tutorial - Cool Search Filter Tutorial
In this video I will teach you guys how to build a cool search bar that filters through data. The search bar will...
Read more >Getting Started with Algolia - Medium
Not long after getting my site set up, I decided that I wanted to have an ... search, which is passed in as...
Read more >Adding Search with Algolia - Gatsby
Search box ; Displaying search results; Tying the search widget together ... to build a search for technical documentation, Algolia provides a product...
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
beforeSearch could be understood as being an event-like hook: not actually expressing we are replacing the helper.search function.
onKeyPress is kind of the same, does it says it’s replacing the default query?
Naming is hard!
I think you summarized this well. No need to change our events or
transformData
-like methods. And this is not a big issue, we just have trouble remembering the option namesThe naming issue might only come from:
queryHook
is called on every keypress, with the actual query and the helper as parameterssearchFunction
is called just before a search is made, with only the helper as parameterMaybe replacing them with:
onQueryChangedHook
, in the searchbox widgetbeforeSearchHook
more globallyJust throwing ideas here. WDYT?