appbaseio / appbaseio/reactivesearch

Do not apply pristine range filters

Abierto
#1,059 5 comentarios 0 reacciones 1 asignado Reclamado por @ShahAnuj2610 Ver en GitHub
bug enhancement
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:** x.y.z
3.0.0-rc.20

**Describe the bug**
When filtering sparse data (i.e., when some of the attributes can be present, but may not be), you want filter components to only be applied when the user explicitly sets them.

For example: I work on a search app that filters by some date field, but that date field is only present in 40% of the documents. When I render the `RangeSlider` component, only items are shown that contain some value for the `dataField` attribute. This means that only documents are shown that have that specific date field.

This happens, because the `RangeSlider` applies a filter to the query with the `range` `start` and `end` values.

Ideally, this filter is only applied after the user interacts with the component. This could be fixed by adding a `pristine` state to `RangeSlider` and others, and only applies the filter when its value is false.

Perhaps this could be set as an optional prop, e.g. `ignoreUntouched`.

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.