Skip to content

Commit

Permalink
fix(slider): labels hide/show moments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandyr committed Jun 6, 2019
1 parent e6023fe commit b3612bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 11 additions & 0 deletions projects/igniteui-angular/src/lib/slider/slider.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,16 @@ export class IgxSliderComponent implements
this.update($event.srcEvent.clientX)
}

@HostListener('panstart')
public onPanStart() {
this.showThumbLabels();
}

@HostListener('panend')
public onPanEnd() {
this.hideThumbLabels();
}

/**
* @hidden
*/
Expand Down Expand Up @@ -880,6 +890,7 @@ export class IgxSliderComponent implements

this.thumbs.changes.pipe(takeUntil(this._destroy$)).subscribe(change => {
const t = change.find((thumb: IgxSliderThumbComponent) => thumb.type === SliderHandle.FROM);
this.positionHandle(t, this.lowerValue);
this.subscribeTo(t, this.thumbChanged.bind(this));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,12 @@ export class IgxSliderThumbComponent implements OnInit, OnDestroy {

@HostListener('blur')
public onBlur() {
this._isActiveLabel = false;
this.isActive = false;
this.onChange.emit();
}

@HostListener('focus')
public onFocusListener() {
this.isActive = true;
this.onChange.emit();
}

public showThumbLabel() {
Expand Down

0 comments on commit b3612bc

Please sign in to comment.