Skip to content

Commit 5829293

Browse files
committed
fix(slider): detecting step dist after content being checked
Closes #5762
1 parent e8da45f commit 5829293

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import {
55
ViewChild,
66
TemplateRef,
77
ContentChild,
8-
AfterContentInit,
98
OnDestroy,
109
HostListener,
1110
ViewChildren,
1211
QueryList,
13-
ChangeDetectorRef
12+
ChangeDetectorRef,
13+
AfterContentChecked
1414
} from '@angular/core';
1515
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
1616
import { EditorProvider } from '../core/edit-provider';
@@ -63,7 +63,7 @@ export class IgxSliderComponent implements
6363
EditorProvider,
6464
OnInit,
6565
AfterViewInit,
66-
AfterContentInit,
66+
AfterContentChecked,
6767
OnDestroy {
6868

6969
// Limit handle travel zone
@@ -713,14 +713,6 @@ export class IgxSliderComponent implements
713713
this.hideSliderIndicators();
714714
}
715715

716-
/**
717-
* @hidden
718-
*/
719-
@HostListener('tap', ['$event'])
720-
public onTapListener($event) {
721-
this.onTap($event);
722-
}
723-
724716
/**
725717
*Returns whether the `IgxSliderComponent` type is RANGE.
726718
*```typescript
@@ -878,7 +870,7 @@ export class IgxSliderComponent implements
878870
/**
879871
* @hidden
880872
*/
881-
public ngAfterContentInit() {
873+
public ngAfterContentChecked() {
882874
// Calculates the distance between every step in pixels.
883875
this.stepDistance = this.calculateStepDistance();
884876
}
@@ -924,13 +916,6 @@ export class IgxSliderComponent implements
924916
return this.isRange ? this.thumbFrom.nativeElement : this.thumbTo.nativeElement;
925917
}
926918

927-
/**
928-
*
929-
* @hidden
930-
*/
931-
public onTap($event) {
932-
// this.update($event.srcEvent.clientX);
933-
}
934919
/**
935920
*
936921
* @hidden

0 commit comments

Comments
 (0)