File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed
components/dash-core-components/src/components
dash/dash-renderer/src/types Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -112,27 +112,25 @@ function Tabs({
112112 return [ children ] ;
113113 } , [ children ] ) ;
114114
115- const valueOrDefault = ( ) => {
115+ const valueOrDefault = ( ) : string | undefined => {
116116 if ( has ( 'value' , props ) ) {
117117 return props . value ;
118118 }
119119 const children = parseChildrenToArray ( ) ;
120120 if ( children && children . length && children [ 0 ] . props . componentPath ) {
121- const firstChildren = window . dash_component_api . getLayout ( [
122- ...children [ 0 ] . props . componentPath ,
123- 'props' ,
124- 'value' ,
125- ] ) ;
126- return firstChildren || 'tab-1' ;
121+ const firstChildren : TabProps = window . dash_component_api . getLayout (
122+ [ ...children [ 0 ] . props . componentPath , 'props' ]
123+ ) ;
124+ return firstChildren . value ;
127125 }
128- return 'tab-1' ;
126+ return undefined ;
129127 } ;
130128
131129 // Initialize value on mount if not set
132130 useEffect ( ( ) => {
133131 if ( ! initializedRef . current && ! has ( 'value' , props ) ) {
134132 props . setProps ( {
135- value : valueOrDefault ( ) ,
133+ value : ` ${ valueOrDefault ( ) } ` ,
136134 } ) ;
137135 initializedRef . current = true ;
138136 }
Original file line number Diff line number Diff line change 2828 box-sizing : border-box;
2929}
3030
31- .tab : last-of-type {
32- border-right : 1px solid var (--tabs-border );
33- border-bottom : 1px solid var (--tabs-border );
34- }
35-
3631.tab : hover {
3732 cursor : pointer;
3833}
6560 border-right : none;
6661}
6762
63+ .tab-parent--above-breakpoint .tab : last-child {
64+ border-right : 1px solid var (--tabs-border );
65+ border-bottom : 1px solid var (--tabs-border );
66+ }
67+
6868.tab-parent--above-breakpoint .tab--selected ,
69- .tab-parent--above-breakpoint .tab : last-of-type .tab--selected {
69+ .tab-parent--above-breakpoint .tab : last-child .tab--selected {
7070 border-bottom : none;
7171}
7272
8181 .tab--selected ,
8282.tab-parent--above-breakpoint
8383 .tab-container : not (.tab-container--vert )
84- .tab : last-of-type .tab--selected {
84+ .tab : last-child .tab--selected {
8585 border-top : 2px solid var (--tabs-primary );
8686}
8787
9191 border-bottom : none !important ;
9292}
9393
94- .tab-parent--above-breakpoint .tab-container--vert .tab : last-of-type {
94+ .tab-parent--above-breakpoint .tab-container--vert .tab : last-child {
9595 border-bottom : 1px solid var (--tabs-border ) !important ;
9696}
9797
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export interface DashComponentApi {
1616 ExternalWrapper : typeof ExternalWrapper ;
1717 DashContext : typeof DashContext ;
1818 useDashContext : typeof useDashContext ;
19- getLayout : ( componentPathOrId : DashLayoutPath | string ) => DashComponent ;
19+ getLayout : ( componentPathOrId : DashLayoutPath | string ) => any ;
2020 stringifyId : typeof stringifyId ;
2121}
2222
You can’t perform that action at this time.
0 commit comments