File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,11 +238,20 @@ export function tabWidget (options: TabWidgetOptions) {
238238 )
239239
240240 const tab = selectedTab1 || selectedTab0 || ( tabContainer . children [ 0 ] as HTMLButtonElement )
241- const clickMe = tab . firstChild
242- // @ts -ignore
243- if ( clickMe ) clickMe . click ( )
241+ const clickMe = tab . firstChild as HTMLElement | null
242+ if ( clickMe ?. click ) {
243+ clickMe . click ( )
244+ } else if ( tab instanceof HTMLElement ) {
245+ tab . click ( )
246+ }
244247 } else if ( ! options . startEmpty ) {
245- ( tabContainer . children [ 0 ] . firstChild as HTMLButtonElement ) . click ( ) // Open first tab
248+ const firstTab = tabContainer . children [ 0 ]
249+ const clickTarget = firstTab ?. firstChild as HTMLElement | null
250+ if ( clickTarget ?. click ) {
251+ clickTarget . click ( )
252+ } else if ( firstTab instanceof HTMLElement ) {
253+ firstTab . click ( ) // Open first tab
254+ }
246255 }
247256 return rootElement
248257
You can’t perform that action at this time.
0 commit comments