Skip to content

Commit 202010d

Browse files
committed
tab.Container: createItems() => override insert() & remove() for the content container #6690
1 parent 3893590 commit 202010d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/tab/Container.mjs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,23 @@ class Container extends BaseContainer {
281281
items : tabComponents,
282282
layout : {ntype: 'card', activeIndex: me.activeIndex, removeInactiveCards: me.removeInactiveCards},
283283
useActiveTabIndicator: me.useActiveTabIndicator,
284-
...me.contentContainer
284+
...me.contentContainer,
285+
286+
insert(index, item, silent) {
287+
if (item?.isTab) {
288+
me.insert(index, item, silent)
289+
} else {
290+
super.insert(index, item, silent)
291+
}
292+
},
293+
294+
remove(component, destroyItem, silent) {
295+
if (component?.isTab) {
296+
me.remove(component, destroyItem, silent)
297+
} else {
298+
super.remove(component, destroyItem, silent)
299+
}
300+
}
285301
}];
286302

287303
me.itemDefaults = null;

0 commit comments

Comments
 (0)