Skip to content

Commit

Permalink
Use [pointerEventsDisabled] to disable pointer events, closes #229
Browse files Browse the repository at this point in the history
  • Loading branch information
MurhafSousli committed Oct 29, 2019
1 parent 55f6dd6 commit ef1176b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/ngx-scrollbar/src/lib/ng-scrollbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class NgScrollbar implements OnInit, AfterViewChecked, OnDestroy {
/** The duration which the scrolling takes to reach its target when scrollbar rail is clicked */
@Input() trackClickScrollDuration = this.manager.globalOptions.trackClickScrollDuration;
/** A flag used to enable/disable the scrollbar thumb dragged event */
@Input() thumbDragDisabled: boolean = this.manager.globalOptions.thumbDragDisabled;
@Input() pointerEventsDisabled: boolean = this.manager.globalOptions.pointerEventsDisabled;
/**
* Sets the pointer events method
* Use viewport pointer events to handle dragging and track click (This makes scrolling work when mouse is over the scrollbar)
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-scrollbar/src/lib/scrollbar/scrollbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export abstract class Scrollbar implements OnInit, OnDestroy {
ngOnInit() {
this.zone.runOutsideAngular(() => {
// Activate pointer events on Desktop only
if (!(this.platform.IOS || this.platform.ANDROID)) {
if (!(this.platform.IOS || this.platform.ANDROID) && !this.cmp.pointerEventsDisabled) {
this.activatePointerEvents().pipe(takeUntil(this.destroyed)).subscribe();
}

Expand Down

0 comments on commit ef1176b

Please sign in to comment.