darul75 / angular-awesome-slider

:arrows_clockwise: Angular slider control directive
http://darul75.github.io/angular-awesome-slider/
MIT License
143 stars 63 forks source link

Updating both range values from code #123

Closed drukavina closed 8 years ago

drukavina commented 8 years ago

Here's a simple example: (http://jsfiddle.net/tv8fdp6o/3/)

I'm trying to change a range value from one range to another range just by setting new model value for slider. Let's say I have a range configured to go from 1 to 10 and initially set range [2,4]. Then I try to set range to [5,7] and I get [4,7] in slider instead. See fiddle for example. It seems that this is happening because new lower value is limited by previous upper value.

darul75 commented 8 years ago

Yes indeed weird but your test case and explanations are perfect, I look asap

drukavina commented 8 years ago

Tnx for the quick response, here's a workaround I'm using now: var _resetValue = function() { $scope.value = $scope.options.from + ';' + $scope.options.to; }; Basically I'm resetting low and high range value before setting new range, then it works. Maybe it helps to create a bugfix. Cheers.

darul75 commented 8 years ago

Nice workaround I have not looked yet but it will help for sure, thx