Skip to content

Commit

Permalink
fix(refresher): get scrollTop from the scroll element to prevent refr…
Browse files Browse the repository at this point in the history
…eshing when dragging up

fixes #5207
  • Loading branch information
brandyscarney committed Feb 29, 2016
1 parent f905e18 commit ea884de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ionic/components/refresher/refresher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions ionic/components/refresher/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
Expand Down Expand Up @@ -82,4 +82,4 @@ const data = [
'Next',
'Kick-Ass',
'Drive Angry'
];
];

0 comments on commit ea884de

Please sign in to comment.