From 34ae9045b7aad74b9e5cf8dd092a49ee3ccd236c Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Fri, 11 May 2018 14:39:25 +0200 Subject: [PATCH] fix(refresher): adds threshold --- core/src/components/refresher/refresher.tsx | 30 ++++++++----------- .../refresher/test/basic/index.html | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index 8da96f7eda..2226c2e1f7 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -26,7 +26,6 @@ export class Refresher { private appliedStyles = false; private didStart = false; - private gestureConfig: any; private progress = 0; private scrollEl: HTMLElement | null = null; @@ -94,22 +93,6 @@ export class Refresher { */ @Event() ionStart!: EventEmitter; - componentWillLoad() { - this.gestureConfig = { - 'canStart': this.canStart.bind(this), - 'onStart': this.onStart.bind(this), - 'onMove': this.onMove.bind(this), - 'onEnd': this.onEnd.bind(this), - 'gestureName': 'refresher', - 'gesturePriority': 10, - 'type': 'pan', - 'passive': false, - 'direction': 'y', - 'threshold': 0, - 'attachTo': this.el.closest('ion-content') - }; - } - componentDidLoad() { if (this.el.getAttribute('slot') !== 'fixed') { console.error('Make sure you use: '); @@ -241,6 +224,7 @@ export class Refresher { } // prevent native scroll events + console.log('preventDefault'); ev.preventDefault(); // the refresher is actively pulling at this point @@ -360,7 +344,17 @@ export class Refresher { } render() { - return ; diff --git a/core/src/components/refresher/test/basic/index.html b/core/src/components/refresher/test/basic/index.html index 96c4c656a8..0080733d96 100644 --- a/core/src/components/refresher/test/basic/index.html +++ b/core/src/components/refresher/test/basic/index.html @@ -54,7 +54,7 @@ function render() { let html = ''; for(let item of items) { - html += `${item}`; + html += `${item}`; } list.innerHTML = html; }