Open joepio opened 4 years ago
Related #739
Actually I think this is not fixed completely.
While the mechanics implemented with the includeNullValues
prop are necessary to get the desired behaviour, a typical solution should be to have something like the ignoreUntouched
prop which @joepio proposed.
The component could then set includeNullValues
to true
internally as long as it is not selected, and turn it to false as soon as there has been user interaction.
In https://github.com/appbaseio/reactivesearch/issues/1096 I suggested that there could be visual indication aswell, like greyed out handles for the initial state.
I agree with @janus-reith, the includeNullValues
prop does not solve this issue by itself.
@bietkul Could you perhaps re-open this issue?
@ShahAnuj2610 Can you please check it.
I agree with @janus-reith, the
includeNullValues
prop does not solve this issue by itself.@bietkul Could you perhaps re-open this issue?
As of now, this approach should work => https://github.com/appbaseio/reactivesearch/issues/1096#issuecomment-528411554
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 thedataField
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 therange
start
andend
values.Ideally, this filter is only applied after the user interacts with the component. This could be fixed by adding a
pristine
state toRangeSlider
and others, and only applies the filter when its value is false.Perhaps this could be set as an optional prop, e.g.
ignoreUntouched
.