-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-discrete sliders often does not snap to nearest step #1431
Comments
@robertmesserle - something is messed up... is mdGestures interfering? |
In slider.js, the slider position is never being updated after the drag / event. The slider position is set in onPressDown at the beginning of the event, but as I mentioned, not after the event. Add setSliderPercentage call after the model is updated? function onPressUp(ev) {
if (isDisabledGetter()) return;
element.removeClass('dragging active');
var exactVal = percentToValue( positionToPercent( ev.pointer.x ));
var closestVal = minMaxValidator( stepValidator(exactVal) );
scope.$apply(function() {
setModelValue(closestVal);
setSliderPercent( valueToPercent(closestVal));
});
} Kind of unrelated, but should there be a blur call in here? |
@robertmesserle - is this an issue with |
@ThomasBurleson I haven't had a chance to look into it yet, but that's what I suspect. Update: After looking into it, |
This was introduced by this change: 7028a75
var exactVal = percentToValue( positionToPercent( ev.pointer.x ));
var closestVal = minMaxValidator( stepValidator(exactVal) );
setSliderPercent( valueToPercent(closestVal)); Edit: disregard the bit about re-adding to onDragEnd. Adding that code in onDragEnd reintroduces unintended 'click' behavior... |
This issue has appeared in the last 2-3 days. An example of this issue can be found here.
The text was updated successfully, but these errors were encountered: