File tree 1 file changed +5
-2
lines changed
packages/components/src/components/hds/layout/flex
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ type AvailableElements = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
13
13
export interface HdsLayoutFlexItemSignature {
14
14
Args : {
15
15
tag ?: AvailableTagNames ;
16
- basis ?: string ;
16
+ basis ?: string | 0 ;
17
17
grow ?: boolean | number | string ;
18
18
shrink ?: boolean | number | string ;
19
19
} ;
@@ -36,7 +36,10 @@ export default class HdsLayoutFlexItem extends Component<HdsLayoutFlexItemSignat
36
36
} = { } ;
37
37
38
38
// we handle all cases of `basis` values via inline styles
39
- if ( this . args . basis ) {
39
+ if ( typeof this . args . basis === 'number' && this . args . basis === 0 ) {
40
+ // the `{{style}}` modifier accepts only strings
41
+ inlineStyles [ 'flex-basis' ] = this . args . basis . toString ( ) ;
42
+ } else if ( typeof this . args . basis === 'string' ) {
40
43
inlineStyles [ 'flex-basis' ] = this . args . basis ;
41
44
}
42
45
You can’t perform that action at this time.
0 commit comments