-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding Side effect #154
Comments
I'm not sure what this issue is. Can you simplify the description without reference to databases and date ranges? Is this a bug report or a feature request or just a request for help in using the rangeslider for your application? |
If you data bind LowerValue and UpperValue to a model with i.e. low = 5 and high = 15, when RangeSlider is initialized it will automatically adjust UpperValue and high to 5
I think it's a bug, expect off course there is a way of changing the default behavior am not aware of then it's a request for help |
If I can simplify this further, are you saying: If you use a RangeSlider, set LowerValue to 5 and set UpperValue to 15, then getting UpperValue gives 5. This certainly seems strange. But is it valid to do this without setting MinimumValue and MaximumValue? If you don't set these then I can imagine that behaviour is undefined. Trying to get towards a minimal example here. |
No, it will not. At least I can't reproduce this behaviour. Can you try to change the sample project to reproduce it? |
Am binding the LowerValue and UpperValue to a date range in my ViewModel, when adding a new model binding work just fine, and reflects on the database.
However, when you call up the model for editing, the UpperValue is automatically set to LowerValue (as implemented in ValidateMinRange and ValidateMaxRange) and since it bounded to the model the actual model also changes and if save will reflect on the database.
Cause:
The RangeSlider is initialized with both thumb set to the MinimuValue, if the lower date of the DateRange model is above the MinimuValue and by implication above the UpperValue the ValidateMinRange function will force UpperValue to LowerValue and off course the upper date of the DateRange is also changed via Binding.
Possible Solution:
Initialize RangeSlider with LowerValue set to MinimuValue and UpperValue set to MaximuValue
Not sure what this attributes is for or how to use them:
The text was updated successfully, but these errors were encountered: