From ea884ded6d1a81b6e533ebcc918b2c8e15d9ea61 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Mon, 29 Feb 2016 13:48:36 -0500 Subject: [PATCH] fix(refresher): get scrollTop from the scroll element to prevent refreshing when dragging up fixes #5207 --- ionic/components/refresher/refresher.ts | 4 ++-- ionic/components/refresher/test/basic/index.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ionic/components/refresher/refresher.ts b/ionic/components/refresher/refresher.ts index 0140e2ba1a..2ffc4a2307 100644 --- a/ionic/components/refresher/refresher.ts +++ b/ionic/components/refresher/refresher.ts @@ -299,10 +299,10 @@ export class Refresher { } if (this.state === STATE_INACTIVE) { - // this refresh is not alreadying actively pulling down + // this refresh is not already actively pulling down // get the content's scrollTop - let scrollHostScrollTop = this._content.getScrollTop(); + let scrollHostScrollTop = this._content.scrollElement.scrollTop; // if the scrollTop is greater than zero then it's // not possible to pull the content down yet diff --git a/ionic/components/refresher/test/basic/index.ts b/ionic/components/refresher/test/basic/index.ts index 0dde21fb59..bad4a02cb7 100644 --- a/ionic/components/refresher/test/basic/index.ts +++ b/ionic/components/refresher/test/basic/index.ts @@ -8,30 +8,30 @@ class E2EApp { items = []; constructor() { - for (var i = 0; i < 3; i++) { + for (var i = 0; i < 15; i++) { this.items.push( getRandomData() ); } } doRefresh(refresher) { - console.log('Begin async operation'); + console.info('Begin async operation'); getAsyncData().then(newData => { for (var i = 0; i < newData.length; i++) { this.items.unshift( newData[i] ); } - console.log('Finished receiving data, async operation complete'); + console.info('Finished receiving data, async operation complete'); refresher.endRefreshing(); }); } doStart(refresher) { - console.log('Refresher, start'); + console.info('Refresher, start'); } doPulling(refresher) { - console.log('Pulling', refresher.progress); + console.info('Pulling', refresher.progress); } } @@ -82,4 +82,4 @@ const data = [ 'Next', 'Kick-Ass', 'Drive Angry' -]; \ No newline at end of file +];