File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -152,12 +152,8 @@ export class TabContainerElement extends HTMLElement {
152
152
153
153
this . addEventListener ( 'keydown' , this )
154
154
this . addEventListener ( 'click' , this )
155
- this . selectTab (
156
- Math . max (
157
- this . #tabs. findIndex ( el => el . matches ( '[aria-selected=true]' ) ) ,
158
- 0 ,
159
- ) ,
160
- )
155
+
156
+ this . selectTab ( - 1 )
161
157
this . #setupComplete = true
162
158
}
163
159
@@ -257,6 +253,8 @@ export class TabContainerElement extends HTMLElement {
257
253
this . #beforeTabsSlot. assign ( ...beforeSlotted )
258
254
this . #afterTabsSlot. assign ( ...afterTabSlotted )
259
255
this . #afterPanelsSlot. assign ( ...afterSlotted )
256
+ const defaultIndex = this . #tabs. findIndex ( el => el . matches ( '[aria-selected=true]' ) )
257
+ index = index >= 0 ? index : Math . max ( 0 , defaultIndex )
260
258
}
261
259
262
260
const tabs = this . #tabs
You can’t perform that action at this time.
0 commit comments