Skip to content

Commit 53ef06f

Browse files
(maint) ensure select avoided when selection is specified
In the case that a selection is specified for tab selection, avoid auto-selecting the first entry.
1 parent eda2b42 commit 53ef06f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

addon/components/ivy-tabs-tablist.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ let instanceCount = 0;
2424
export default class IvyTabsTabListComponent extends Component {
2525
registerWithTabsContainer = modifier(() => {
2626
this.args.tabsContainer.registerTabList(this);
27-
// if none of the tabs are selected, try to select one
28-
let selected = this.tabs.find((tab) => tab.isSelected);
29-
if (!selected && this.tabs.length > 0) {
30-
this.selectTab();
31-
}
3227
return () => {
3328
this.args.tabsContainer.unregisterTabList(this);
3429
};
@@ -209,7 +204,7 @@ export default class IvyTabsTabListComponent extends Component {
209204
selectTab() {
210205
const selection = this.selection;
211206

212-
if (isNone(selection) || this.tabs.length === 1) {
207+
if (isNone(selection) && this.tabs.length === 1) {
213208
this.selectTabByIndex(0);
214209
} else {
215210
this.selectTabByModel(selection);

0 commit comments

Comments
 (0)