appbaseio / appbaseio/reactivesearch

Controlled DataSearch autosuggestions not debounced

Abierto
#1,360 14 comentarios 4 reacciones 1 asignado Reclamado por @mohdashraf010897 Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
4.9k
Forks
478
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.