Skip to content

Commit ae40edf

Browse files
committed
fix(tabs): fix tabs rootNav
1 parent ed6d0fa commit ae40edf

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/components/tabs/tabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ export class Tabs extends Ion {
509509
*/
510510
get rootNav(): NavController {
511511
let nav = this.parent;
512-
while (nav.parent) {
512+
while (nav && nav.parent) {
513513
nav = nav.parent;
514514
}
515515
return nav;

src/util/ui-event-manager.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class PointerEvents {
2525
private pointerUp: any,
2626
private zone: boolean,
2727
private option: any) {
28-
28+
2929
this.rmTouchStart = listenEvent(ele, 'touchstart', zone, option, (ev: any) => this.handleTouchStart(ev));
3030
this.rmMouseStart = listenEvent(ele, 'mousedown', zone, option, (ev: any) => this.handleMouseDown(ev));
3131
}
@@ -92,19 +92,19 @@ export class PointerEvents {
9292
destroy() {
9393
this.rmTouchStart && this.rmTouchStart();
9494
this.rmTouchStart = null;
95-
95+
9696
this.rmMouseStart && this.rmMouseStart();
9797
this.rmMouseStart = null;
9898

99-
this.stop();
100-
99+
this.stop();
100+
101101
this.pointerDown = null;
102102
this.pointerMove = null;
103103
this.pointerUp = null;
104104

105105
this.ele = null;
106-
}
107-
106+
}
107+
108108
}
109109

110110

@@ -119,8 +119,8 @@ export class UIEventManager {
119119
listenRef(ref: ElementRef, eventName: string, callback: any, option?: any): Function {
120120
return this.listen(ref.nativeElement, eventName, callback, option);
121121
}
122-
123-
pointerEventsRef(ref: ElementRef, pointerStart: any, pointerMove: any, pointerEnd: any, option?: any): Function {
122+
123+
pointerEventsRef(ref: ElementRef, pointerStart: any, pointerMove: any, pointerEnd: any, option?: any): PointerEvents {
124124
return this.pointerEvents(ref.nativeElement, pointerStart, pointerMove, pointerEnd, option);
125125
}
126126

@@ -135,7 +135,7 @@ export class UIEventManager {
135135
pointerUp,
136136
this.zoneWrapped,
137137
option);
138-
138+
139139
let removeFunc = () => submanager.destroy();
140140
this.events.push(removeFunc);
141141
return submanager;
@@ -155,7 +155,7 @@ export class UIEventManager {
155155
event();
156156
}
157157
this.events.length = 0;
158-
}
158+
}
159159
}
160160

161161
function listenEvent(ele: any, eventName: string, zoneWrapped: boolean, option: any, callback: any): Function {

0 commit comments

Comments
 (0)