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.

[searchBox]: queryHook not called on initial search

See original GitHub issue

Currently 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:closed
  • Created 8 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
vvocommented, Mar 8, 2016

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!

0reactions
pixelasticcommented, Mar 9, 2016

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 names

The naming issue might only come from:

  • queryHook is called on every keypress, with the actual query and the helper as parameters
  • searchFunction is called just before a search is made, with only the helper as parameter

Maybe replacing them with:

  • onQueryChangedHook, in the searchbox widget
  • beforeSearchHook more globally

Just throwing ideas here. WDYT?

Read more comments on GitHub >

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

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