From b995ca8df4595b3891bba80eaedacd1d1eeb66f8 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 21 Jan 2017 00:05:09 +0100 Subject: [PATCH 1/4] fix(navPop): unhandled promise exception --- src/components/nav/nav-pop.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/nav/nav-pop.ts b/src/components/nav/nav-pop.ts index a06a479d33..3aa5ef7e22 100644 --- a/src/components/nav/nav-pop.ts +++ b/src/components/nav/nav-pop.ts @@ -43,7 +43,9 @@ export class NavPop { onClick(): boolean { // If no target, or if target is _self, prevent default browser behavior if (this._nav) { - this._nav.pop(null, null); + this._nav.pop().catch(() => { + console.debug('navPop was rejected'); + }); return false; } From 8c4fd56b81ac87b8efaf25c9da928059a954e5ea Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 21 Jan 2017 00:05:29 +0100 Subject: [PATCH 2/4] fix(navPush): unhandled promise exception --- src/components/nav/nav-push.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/nav/nav-push.ts b/src/components/nav/nav-push.ts index 34eb0707ee..5dd2579371 100644 --- a/src/components/nav/nav-push.ts +++ b/src/components/nav/nav-push.ts @@ -72,7 +72,9 @@ export class NavPush { @HostListener('click') onClick(): boolean { if (this._nav && this.navPush) { - this._nav.push(this.navPush, this.navParams, null); + this._nav.push(this.navPush, this.navParams).catch(() => { + console.debug('navPush was rejected'); + }); return false; } return true; From ee2268f42a05208822c0b3bf39e824a6c7c4dd23 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 21 Jan 2017 00:20:27 +0100 Subject: [PATCH 3/4] fix(alert): unhandled promise exception --- src/components/alert/alert-component.ts | 4 +++- src/components/tabs/test/advanced/app.module.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 70f04dbf9f..29f3ced9f3 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -259,7 +259,9 @@ export class AlertCmp { } if (shouldDismiss) { - this.dismiss(button.role); + this.dismiss(button.role).catch(() => { + console.debug('alert can not be dismissed'); + }); } } diff --git a/src/components/tabs/test/advanced/app.module.ts b/src/components/tabs/test/advanced/app.module.ts index f7bdf718ab..d2a696f3aa 100644 --- a/src/components/tabs/test/advanced/app.module.ts +++ b/src/components/tabs/test/advanced/app.module.ts @@ -81,6 +81,7 @@ export class TabsPage { alert.dismiss().then(() => { resolve(); }); + return false; } } ] From 23a70e151ee3f2d2dfe2ce636ba5a5d7bb50f916 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 21 Jan 2017 00:56:09 +0100 Subject: [PATCH 4/4] fix(gestures): drag events are debounced - Performance regressions in menu, sliding item, toggle, go back swipe and scroll up to refresh. - Buggy sliding item --- src/components/item/item-sliding.ts | 42 +++++++++++++---------------- src/gestures/drag-gesture.ts | 4 ++- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/components/item/item-sliding.ts b/src/components/item/item-sliding.ts index b3c8840dd8..68a919988e 100644 --- a/src/components/item/item-sliding.ts +++ b/src/components/item/item-sliding.ts @@ -315,12 +315,7 @@ export class ItemSliding { openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR; } - // this.debouncer.write(() => { - - // }); - this._dom.write(() => { - this._setOpenAmount(openAmount, false); - }); + this._setOpenAmount(openAmount, false); return openAmount; } @@ -362,29 +357,30 @@ export class ItemSliding { * @private */ private calculateOptsWidth() { - this._plt.raf(() => { - if (!this._optsDirty) { - return; - } - this._optsWidthRightSide = 0; - if (this._rightOptions) { - this._optsWidthRightSide = this._rightOptions.width(); - assert(this._optsWidthRightSide > 0, '_optsWidthRightSide should not be zero'); - } + if (!this._optsDirty) { + return; + } + this._optsWidthRightSide = 0; + if (this._rightOptions) { + this._optsWidthRightSide = this._rightOptions.width(); + assert(this._optsWidthRightSide > 0, '_optsWidthRightSide should not be zero'); + } - this._optsWidthLeftSide = 0; - if (this._leftOptions) { - this._optsWidthLeftSide = this._leftOptions.width(); - assert(this._optsWidthLeftSide > 0, '_optsWidthLeftSide should not be zero'); - } - this._optsDirty = false; - }); + this._optsWidthLeftSide = 0; + if (this._leftOptions) { + this._optsWidthLeftSide = this._leftOptions.width(); + assert(this._optsWidthLeftSide > 0, '_optsWidthLeftSide should not be zero'); + } + this._optsDirty = false; } private _setOpenAmount(openAmount: number, isFinal: boolean) { const platform = this._plt; - platform.cancelTimeout(this._tmr); + if (this._tmr) { + platform.cancelTimeout(this._tmr); + this._tmr = null; + } this._openAmount = openAmount; if (isFinal) { diff --git a/src/gestures/drag-gesture.ts b/src/gestures/drag-gesture.ts index 9a9d1e1a41..bce37e86d4 100644 --- a/src/gestures/drag-gesture.ts +++ b/src/gestures/drag-gesture.ts @@ -110,7 +110,9 @@ export class PanGesture { pointerMove(ev: any) { assert(this.started === true, 'started must be true'); if (this.captured) { - this.onDragMove(ev); + this.debouncer.write(() => { + this.onDragMove(ev); + }); return; }