appbaseio / appbaseio/reactivesearch

Controlled DataSearch autosuggestions not debounced

Offen
#1,360 14 Kommentare 4 Reaktionen 1 zugewiesene Person Beansprucht von @mohdashraf010897 Auf GitHub ansehen
bug
Vorherrschende Sprache
JavaScript
Sterne
4.9k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Affected Projects**
React

**Library Version:** 3.x

**Describe the bug**
When you use a `` as a controlled component with `value` and `onValueChange` props the `componentDidUpdate` method calls `setValue` with `isDefaultValue=true`.

This means de-bouncing is ignored for the autosuggest query and causes the interface to be slow and places extra load on Elasticsearch.

Changing the `isDefaultValue` value to false in the `componentDidUpdate` method fixes the issue for me. I'm not sure how this parameter is used as it is explicitly set to `true` everywhere it is called inside `DataSearch`. The debounced key handler is only ever used if it is passed to `setValue` as `false`.

**Expected behavior**
When using `` as a controlled component, autosuggest queries should be debounced according to the value set on the `debounce` prop.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.