You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug 🐛
Problem with NumberRangeInteractor and NumberRangeObservableController
When an initial search is done, the right values are found. But after, if I am doing another search with a different text, the range does not change!!
Expected behavior 💭
The new query is taken into account for the new values of the range
Environment:
OS: iOS - SwiftUI
Version device: 15.4.1
Version SDK Algolia: InstantSearch v7.17.0
Additional context
For a marketplace type application on iOS, I am adding functionalities such as selectable segment, hierarchical categories, dynamic facets and a Range Slider for the price. I also have a search bar for searching.
Works well for all EXCEPT the Range Slider. When an initial search is done, the right values are found. But after, if I am doing another search with a different text, the range does not change!!
I have this numericRangeInteractor that I connected to my FilterState and searcher, and finally my controller (NumericRangeController)
For info I have connector my Numeric Range Interactor this following way take the traditional RangeSlider as my slider.
This is an expected behaviour. Both NumberRangeInteractor and NumberInteractor uses only the initial bounds value from facet stats and use them to setup widget bounds.
That is to say, they shows the bounds for the entire set of hits.
Please note that the bounds values change on each search response and represent the bounds for the current set of hits .
Let's say you have a numeric facet value controlled by a range slider.
Its initial bounds: 0...5, initial value: 0...5. It looks as follows: 0 |>----<| 5
You change the lower slider value to 1. 0 |->---<| 5
The value of the filter changes to 1...5, a new search request launched.
A new search response received with bounds 1...5
In case these new bounds applied to your widget, it now looks as follows: 1 |>---<| 5
From this state it's impossible to change the lower range value back to 0 without the complete removal of the filter.
That's why the numeric interactors only take into account the bounds for the entire set of hits and not updated on each result.
If you want to implement a custom behaviour for your range widget, you can make it conform to Boundable protocol and connect it to the HitsSearcher using the connect method. Then, you can implement the behaviour your expect in the applyBounds method implementation.
Describe the bug 🐛
Problem with NumberRangeInteractor and NumberRangeObservableController
When an initial search is done, the right values are found. But after, if I am doing another search with a different text, the range does not change!!
Expected behavior 💭
The new query is taken into account for the new values of the range
Environment:
Additional context
For a marketplace type application on iOS, I am adding functionalities such as selectable segment, hierarchical categories, dynamic facets and a Range Slider for the price. I also have a search bar for searching.
Works well for all EXCEPT the Range Slider. When an initial search is done, the right values are found. But after, if I am doing another search with a different text, the range does not change!!
I have this numericRangeInteractor that I connected to my FilterState and searcher, and finally my controller (NumericRangeController)
For info I have connector my Numeric Range Interactor this following way take the traditional RangeSlider as my slider.
Any idea? I tested everything.
Thanks !!!
The text was updated successfully, but these errors were encountered: