Skip to content

Commit f587f2e

Browse files
author
Marcin Strażyński
authored
Setting up max-width to modal (#564)
1 parent be4759b commit f587f2e

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/components/modal/Modal.stories.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,32 @@ import { Button } from "../button";
118118
}}
119119
</Story>
120120
</Canvas>
121+
122+
### Modal Confirm with long text and scroll
123+
124+
<Canvas>
125+
<Story name="confirm modal long body text">
126+
{() => {
127+
const { isOpen, open, close } = useDisclosure();
128+
const action = () => alert("Confirmed");
129+
return (
130+
<>
131+
<Button onClick={open}>Open modal</Button>
132+
<ModalConfirm
133+
contentLabel="Account"
134+
isOpen={isOpen}
135+
confirm={action}
136+
onClose={close}
137+
actionLabel="Confirm"
138+
>
139+
Do you really want to delete account{" "}
140+
<em>
141+
1033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e141033195400904dd389a6788ef9de5e14
142+
</em>
143+
?
144+
</ModalConfirm>
145+
</>
146+
);
147+
}}
148+
</Story>
149+
</Canvas>

src/components/modal/styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const showTranslateY = keyframes`
3131

3232
export const ModalBox = styled(Box)<ModalBoxProps>`
3333
min-width: ${({ modalMinWidth }) => modalMinWidth || "32rem"};
34-
overflow: hidden;
34+
max-width: 95vw;
35+
overflow: auto;
3536
font-family: ${theme.fonts.body};
3637
line-height: ${theme.lineHeight};
3738
opacity: 0;

0 commit comments

Comments
 (0)