Skip to content

Commit

Permalink
fix(module:pulltorefresh): fix when up pull, then down pull, emit ref…
Browse files Browse the repository at this point in the history
…resh error (#248)

* fix(module:pulltorefresh): fix when up pull, then down pull, emit refresh error
  • Loading branch information
nuonuoge authored and Guoyuanqiang committed Jan 15, 2019
1 parent f82b7dd commit 5fd57d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/pull-to-refresh/pull-to-refresh.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class PullToRefreshComponent implements ControlValueAccessor {
touchstart(e) {
this._startTime = Date.now();
if (this._direction === 'down' || (this._direction === '' && !this._endRreach)) {
if (document.getElementsByTagName('pulltorefresh')[0].scrollTop > 0) {
if (this.ele.nativeElement.scrollTop > 0) {
this.startY = undefined;
return;
}
Expand All @@ -134,7 +134,7 @@ export class PullToRefreshComponent implements ControlValueAccessor {
@HostListener('touchmove', ['$event'])
touchmove(e) {
if (this._direction === 'down' || (this._direction === '' && !this._endRreach)) {
if (!this.startY) {
if (this.ele.nativeElement.scrollTop > 0) {
return;
}
let distanceY = e.changedTouches[0].clientY - this.startY;
Expand Down

0 comments on commit 5fd57d7

Please sign in to comment.