Skip to content

Commit 23e4a2d

Browse files
authored
fix(S2): Allow custom widths on CustomDialogs (#8820)
1 parent 1d1ca90 commit 23e4a2d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

packages/@react-spectrum/s2/src/CustomDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const dialogStyle = style({
5353
position: 'relative',
5454
size: 'full',
5555
maxSize: 'inherit'
56-
}, getAllowedOverrides({height: true}));
56+
}, getAllowedOverrides({height: true, width: true}));
5757

5858
/**
5959
* A CustomDialog is a floating window with a custom layout.

packages/@react-spectrum/s2/stories/CustomDialog.stories.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,20 @@ export const SideImage: Story = {
120120
</DialogTrigger>
121121
)
122122
};
123+
124+
export const CustomWidth: Story = {
125+
render: (args) => (
126+
<DialogTrigger>
127+
<ActionButton>Open dialog</ActionButton>
128+
<CustomDialog {...args} styles={style({width: 900})}>
129+
<div className={style({display: 'flex', flexDirection: 'column', rowGap: 8, alignItems: 'center'})}>
130+
<Checkmark />
131+
<Heading slot="title" styles={style({font: 'heading-lg', textAlign: 'center', marginY: 0})}>Thank you!</Heading>
132+
<p className={style({font: 'body', textAlign: 'center', marginY: 0})}>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
133+
<CloseButton styles={style({position: 'absolute', top: 12, insetEnd: 12})} />
134+
</div>
135+
</CustomDialog>
136+
</DialogTrigger>
137+
),
138+
tags: ['!autodocs']
139+
};

0 commit comments

Comments
 (0)