Skip to content

Commit

Permalink
fix(module: carousel): add stopPropagation when touch action is trigg…
Browse files Browse the repository at this point in the history
…ered (NG-ZORRO#61)
  • Loading branch information
fisherspy authored and 3fuyu committed Oct 18, 2018
1 parent 3ce2ee0 commit c44ba59
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class CarouselComponent implements AfterViewInit, OnDestroy {
@HostListener('mousedown', ['$event'])
@HostListener('touchstart', ['$event'])
panstart(event) {
event.stopPropagation();
if (!this.dragging) {
return;
}
Expand All @@ -99,6 +100,7 @@ export class CarouselComponent implements AfterViewInit, OnDestroy {
@HostListener('mousemove', ['$event'])
@HostListener('touchmove', ['$event'])
panmove(event) {
event.stopPropagation();
if (!this.dragging && !this._isMouseDown) {
return;
}
Expand Down Expand Up @@ -135,7 +137,8 @@ export class CarouselComponent implements AfterViewInit, OnDestroy {
@HostListener('mouseleave', ['$event'])
@HostListener('mouseup', ['$event'])
@HostListener('touchend', ['$event'])
panend() {
panend(event) {
event.stopPropagation();
if (!this.dragging && !this._isMouseDown) {
return;
}
Expand Down

0 comments on commit c44ba59

Please sign in to comment.