appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.9k stars 468 forks source link

DataSearch component - controlled behaviour not working #2114

Open cohenj-else opened 2 years ago

cohenj-else commented 2 years ago

Affected Projects React

Library Version: x.y.z 3.41.1 (working correctly in 3.0.0)

Describe the bug When using the controlled behaviour of the DataSearch component to only trigger 'on enter' (as described here https://github.com/appbaseio/reactivesearch/issues/994#issuecomment-511854980) , query is triggered on every keypress.

To Reproduce Edit reactivesearch-quickstart-final-app (forked)

Steps to reproduce the behavior: Using above codesandbox:

Type in search box, query is made on every keypress.

Expected behavior Type in search box, query is made only after key 'enter'. (switching library version to 3.0.0 and behaviour is as expected).

Thanks for your help and for a great library!

cohenj-else commented 2 years ago

This is working correctly for the SearchBox component, so that is a fine alternative. Probably this can be closed if you prefer. Thanks!

rs-unsilo commented 1 year ago

We have this issue as well. We want to use "DataSearch". Can it be fixed instead?

siddharthlatest commented 1 year ago

@rs-unsilo Any reason to use DataSearch over SearchBox?

rs-unsilo commented 1 year ago

We use a customQuery directly to an elastic endpoint. Is that possible with SearchBox? IE. connect directly to an elastic endpoint (via a local proxy). From documentation it sounds a lot more bothersome with having to use a third party service, etc. compared to DataSearch

Regarding DataSearch - It must be a quite obvious bug to fix? triggeQuery() is called on every keystroke no matter how you set it up