Skip to content

Commit 538ebfc

Browse files
Push empty node if no match
1 parent def2c59 commit 538ebfc

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/components/navigation/IonTabs.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
import Vue, { CreateElement, RenderContext, VNode } from 'vue';
22
import { Route } from 'vue-router';
33

4-
const hostStyles = {
5-
display: 'flex',
6-
position: 'absolute',
7-
top: 0,
8-
left: 0,
9-
right: 0,
10-
bottom: 0,
11-
flexDirection: 'column',
12-
width: '100%',
13-
height: '100%',
14-
};
15-
16-
const tabsInner = {
17-
position: 'relative',
18-
flex: 1,
19-
};
20-
214
const tabBars = [] as VNode[];
225
const cachedTabs = [] as VNode[];
236

@@ -62,10 +45,9 @@ export default {
6245
continue;
6346
}
6447

65-
// Tab was previously cached, push to render queue but don't activate
66-
if (tabIsCached) {
67-
renderQueue.push(vnode);
68-
}
48+
// If tab was previously cached, push to render queue but don't activate
49+
// Otherwise push an empty node
50+
renderQueue.push(tabIsCached ? vnode : h());
6951
}
7052

7153
// Post processing after initial render
@@ -193,3 +175,20 @@ function matchRouteToTab(vnode: VNode, route: Route): string {
193175

194176
return '';
195177
}
178+
179+
const hostStyles = {
180+
display: 'flex',
181+
position: 'absolute',
182+
top: 0,
183+
left: 0,
184+
right: 0,
185+
bottom: 0,
186+
flexDirection: 'column',
187+
width: '100%',
188+
height: '100%',
189+
};
190+
191+
const tabsInner = {
192+
position: 'relative',
193+
flex: 1,
194+
};

0 commit comments

Comments
 (0)