File tree Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const DxcTab = forwardRef(
5050
5151 useEffect ( ( ) => {
5252 if ( active ) {
53- setActiveTab ?.( tabId ) ;
53+ setActiveTab ?.( tabId ?? label ?? "" ) ;
5454 }
5555 } , [ active , label , setActiveTab ] ) ;
5656
Original file line number Diff line number Diff line change @@ -77,17 +77,11 @@ const DxcTabs = ({
7777 const hasActiveChild = childrenArray . some (
7878 ( child ) => isValidElement ( child ) && ( child . props . active || child . props . defaultActive ) && ! child . props . disabled
7979 ) ;
80- console . log ( `hasActiveChild: ${ hasActiveChild } ` ) ;
8180 const initialActiveTab = hasActiveChild
8281 ? childrenArray . find (
8382 ( child ) => isValidElement ( child ) && ( child . props . active || child . props . defaultActive ) && ! child . props . disabled
8483 )
8584 : childrenArray . find ( ( child ) => isValidElement ( child ) && ! child . props . disabled ) ;
86- console . log ( initialActiveTab ) ;
87-
88- console . log (
89- isValidElement ( initialActiveTab ) ? ( initialActiveTab . props . label ?? initialActiveTab . props . tabId ) : "not valid"
90- ) ;
9185
9286 return isValidElement ( initialActiveTab ) ? ( initialActiveTab . props . label ?? initialActiveTab . props . tabId ) : "" ;
9387 } ) ;
You can’t perform that action at this time.
0 commit comments