Skip to content

Commit acae976

Browse files
committed
fix(slider): aligned slider functionality with Edge and IE
Closes #3449
1 parent d449ca9 commit acae976

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

projects/igniteui-angular/src/lib/slider/slider.component.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -388,19 +388,15 @@ export class IgxSliderComponent implements
388388
@Input()
389389
@DeprecateProperty(`IgxSliderComponent \`isContinuous\` property is deprecated.\nUse \`continuous\` instead.`)
390390
public get isContinuous(): boolean {
391-
return this._countinuous;
391+
return this.continuous;
392392
}
393393

394394
/**
395395
* @hidden
396396
* @internal
397397
*/
398398
public set isContinuous(continuous: boolean) {
399-
if (this.labelsViewEnabled) {
400-
return;
401-
}
402-
403-
this._countinuous = continuous;
399+
this.continuous = continuous;
404400
}
405401

406402
/**
@@ -934,12 +930,12 @@ export class IgxSliderComponent implements
934930
*/
935931
public findClosestThumb(event) {
936932
if (this.isRange) {
937-
this.closestHandle(event.x);
933+
this.closestHandle(event.clientX);
938934
} else {
939935
this.thumbTo.nativeElement.focus();
940936
}
941937

942-
this.update(event.x);
938+
this.update(event.clientX);
943939

944940
event.preventDefault();
945941
}
@@ -1016,7 +1012,7 @@ export class IgxSliderComponent implements
10161012
private closestHandle(mouseX) {
10171013
const fromOffset = this.thumbFrom.nativeElement.offsetLeft + this.thumbFrom.nativeElement.offsetWidth / 2;
10181014
const toOffset = this.thumbTo.nativeElement.offsetLeft + this.thumbTo.nativeElement.offsetWidth / 2;
1019-
const xPointer = mouseX - this.slider.nativeElement.getBoundingClientRect().x;
1015+
const xPointer = mouseX - this.slider.nativeElement.getBoundingClientRect().left;
10201016
const match = this.closestTo(xPointer, [fromOffset, toOffset]);
10211017

10221018
if (match === fromOffset) {

projects/igniteui-angular/src/lib/slider/thumb/thumb-slider.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class IgxSliderThumbComponent implements OnInit, OnDestroy {
8282
private get _thumbPositionX() {
8383
const thumbBounderies = this.nativeElement.getBoundingClientRect();
8484
const thumbCenter = (thumbBounderies.right - thumbBounderies.left) / 2;
85-
return thumbBounderies.x + thumbCenter;
85+
return thumbBounderies.left + thumbCenter;
8686
}
8787

8888
constructor (private _elementRef: ElementRef) { }

0 commit comments

Comments
 (0)