fix(range): knob B can only be actived if range is dual

This commit is contained in:
Manu Mtz.-Almeida
2017-03-03 23:56:59 +01:00
parent b541832749
commit d538245178

View File

@@ -368,7 +368,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
// figure out which knob they started closer to
const ratio = clamp(0, (current.x - rect.left) / (rect.width), 1);
this._activeB = (Math.abs(ratio - this._ratioA) > Math.abs(ratio - this._ratioB));
this._activeB = this._dual && (Math.abs(ratio - this._ratioA) > Math.abs(ratio - this._ratioB));
// update the active knob's position
this._update(current, rect, true);