fix(range): bar width works as expected

fixes  #10150
This commit is contained in:
Manu Mtz.-Almeida
2017-03-03 23:49:01 +01:00
parent 05859dba40
commit b541832749

View File

@ -428,18 +428,14 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
// update which knob is pressed
this._pressed = isPressed;
let valChanged = false;
if (this._activeB) {
// when the pointer down started it was determined
// that knob B was the one they were interacting with
this._pressedB = isPressed;
this._pressedA = false;
this._ratioB = ratio;
if (val === this._valB) {
// hasn't changed
return false;
}
valChanged = val === this._valB;
this._valB = val;
} else {
@ -447,13 +443,13 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
this._pressedA = isPressed;
this._pressedB = false;
this._ratioA = ratio;
if (val === this._valA) {
// hasn't changed
return false;
}
valChanged = val === this._valA;
this._valA = val;
}
this._updateBar();
if (valChanged) {
return false;
}
// value has been updated
if (this._dual) {
@ -478,8 +474,6 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
this.ionChange.emit(this);
});
this._updateBar();
return true;
}