appbaseio / appbaseio/reactivesearch

Do not apply pristine range filters

Offen
#1,059 5 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @ShahAnuj2610 Auf GitHub ansehen
bug enhancement
Vorherrschende Sprache
JavaScript
Sterne
4.9k
Forks
478
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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