Skip to content

Commit

Permalink
fix(scroll enablement): fix scrolling on android devices (#1491)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifoosid committed Apr 16, 2020
1 parent 38ffd25 commit df19ede
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/base/src/delegate/ScrollEnablement.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ class ScrollEnablement extends EventProvider {
isLeft: dragX > this._prevDragX,
isRight: dragX < this._prevDragX,
});

this._prevDragX = dragX;
this._prevDragY = dragY;
}

ontouchend(event) {
Expand All @@ -105,8 +102,8 @@ class ScrollEnablement extends EventProvider {
}

const container = this._container;
const dragX = this.isPhone ? event.pageX : event.x;
const dragY = this.isPhone ? event.pageY : event.y;
const dragX = this.isPhone ? event.changedTouches[0].pageX : event.x;
const dragY = this.isPhone ? event.changedTouches[0].pageY : event.y;

container.scrollLeft += this._prevDragX - dragX;
container.scrollTop += this._prevDragY - dragY;
Expand Down

0 comments on commit df19ede

Please sign in to comment.