Skip to content

Commit dc44083

Browse files
authored
feat: TET-660 fix width button issue (#150)
1 parent 2070c34 commit dc44083

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/components/Button/Button.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@ export const BareDisabled: Story = {
157157
variant: 'bare',
158158
},
159159
};
160+
161+
// should automatically fill the width of the container
162+
export const WithFlexContainer: Story = {
163+
render: () => (
164+
<div style={{ display: 'flex', width: '400px', flexDirection: 'column' }}>
165+
<Button label="Button 1" />
166+
</div>
167+
),
168+
};

src/components/Button/Button.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ const commonConfig = {
287287
display: 'inline-flex',
288288
borderRadius: '$border-radius-large',
289289
gap: '$space-component-gap-small',
290-
w: 'fit-content',
290+
w: 'auto',
291291
justifyContent: 'center',
292292
alignItems: 'center',
293293
textAlign: 'center',

src/components/Button/stylesBuilder/stylesBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('stylesBuilder', () => {
5454
textAlign: 'center',
5555
transition: true,
5656
transitionDuration: 200,
57-
w: 'fit-content',
57+
w: 'auto',
5858
whiteSpace: 'nowrap',
5959
},
6060
loader: {

0 commit comments

Comments
 (0)