Skip to content

Commit 073ad78

Browse files
committed
Fix mobile layout for request forms: use max-width on iframes instead of width attribute to avoid overflow on phones
- Updated Form component (snippets/form.mdx) to render <iframe> with style={{width:'100%', maxWidth}} instead of width={width} attr - Updated .form styles (style.css): box-sizing:border-box + default max-width:500px for robustness
1 parent 0bd28c8 commit 073ad78

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

snippets/form.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
export const Form = ({ src, width="500", height="1000" }) => {
2+
const maxWidth = `${parseInt(width, 10) || 500}px`;
23
return <iframe
34
className="form"
45
src={src}
5-
width={width}
66
height={height}
7+
style={{ width: '100%', maxWidth }}
78
frameborder="0"
89
allowfullscreen>
910
</iframe>

style.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
letter-spacing: -1%;
99
}
1010
.form {
11+
box-sizing: border-box;
1112
padding: 15px;
1213
width: 100%;
14+
max-width: 500px;
1315
min-height: 300px;
1416
overflow-y: auto;
1517
}

0 commit comments

Comments
 (0)