igx-slider - slider comes to not work well after changing maxValue.
Description
slider comes to not work well after changing maxValue.
Steps to reproduce
- Go to https://stackblitz.com/edit/igx-slider-issue
- At first, max value is 10. Drag a slider and move to the right end.
- Then, click a "Change MaxValue to 100" button so that max value is changed to 100.
- Drag the slider and move back to the left then move to the right end again.
Result
At step 4, I can't move slider to the right end.
Expected result
Slider should work well even if after changing maxValue.
It seems the upperBound property is not updated with the new maxValue.
I guess we can make it to automatically react on maxValue changes but in that case
we risk overwriting user data passed to the upperBound input itself.
@kdinev your thoughts on this?
@rkaraivanov I think the upperBound should be adjusted if the maxValue changes and exceeds the upperBound. However, currently, if maxValue is set programmatically, then upper bound can also be set, so it's not like currently the same is not achievable.
Question: Can maxValue change from somewhere else other than an API call?
I suggest checking upperBound/lowerBound when the component is initialized. If they are undefined, then we can make upperBound/lowerBound change whenever maxValue/minValue change. Otherwise, we simply assume that the user is responsible for updating upperBound/lowerBound accordingly.
@kdinev, @rkaraivanov what would you say?
@SAndreeva We should make the upperBound to not be set to maxValue internally if the user doesn't set it. Otherwise if the user has set it, we shouldn't touch it.
Unfortunately this approach will break some other logic, therefore some more refactoring will be needed.
I have implemented a fix, based on my suggestion above. Slider behaves as expected and all tests are passing. Shall we apply that fix?