Skip to content

Commit

Permalink
fix: always disable document scroll when dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlewis92 committed Apr 19, 2020
1 parent c070afa commit 7276cab
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,25 @@ export class DraggableDirective implements OnInit, OnChanges, OnDestroy {
}

private enableScroll() {
this.renderer.setStyle(this.getScrollElement(), 'overflow', '');
if (this.scrollContainer) {
this.renderer.setStyle(
this.scrollContainer.elementRef.nativeElement,
'overflow',
''
);
}
this.renderer.setStyle(this.document.body, 'overflow', '');
}

private disableScroll() {
this.renderer.setStyle(this.getScrollElement(), 'overflow', 'hidden');
if (this.scrollContainer) {
this.renderer.setStyle(
this.scrollContainer.elementRef.nativeElement,
'overflow',
'hidden'
);
}
this.renderer.setStyle(this.document.body, 'overflow', 'hidden');
}

private hasScrollbar(): boolean {
Expand Down

0 comments on commit 7276cab

Please sign in to comment.