Skip to content

Commit 82a0cdc

Browse files
authored
fix: Modal text input can be resized smaller than its cell in Safari browser (#2930)
1 parent b3413ba commit 82a0cdc

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/components/Field/Field.react.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ const Field = ({ label, input, labelWidth = 50, labelPadding, height, className
2222
});
2323
}
2424
return (
25-
<div className={classes.join(' ')}>
25+
<div
26+
className={classes.join(' ')}
27+
style={{ '--modal-label-ratio': labelWidth / 100 }}
28+
>
2629
<div
2730
className={styles.left}
2831
style={{
2932
height: height,
30-
'--modal-label-ratio': labelWidth / 100,
3133
}}
3234
>
3335
{label}

src/components/Field/Field.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
display: flex;
3030
align-items: center;
3131
flex-shrink: 0;
32-
width: calc(var(--modal-min-width, 540px) * var(--modal-label-ratio, 0.5));
33-
max-width: calc(var(--modal-min-width, 540px) * var(--modal-label-ratio, 0.5));
32+
width: calc(var(--modal-min-width) * var(--modal-label-ratio));
33+
max-width: calc(var(--modal-min-width) * var(--modal-label-ratio));
3434
}
3535

3636
.right {
37+
--modal-row-min-height: 80px;
3738
position: relative;
38-
min-height: 80px;
39+
min-height: var(--modal-row-min-height);
3940
text-align: right;
4041
padding: 0;
4142
background: #f6fafb;

src/components/TextInput/TextInput.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
background: $inputBackgroundColor;
1515
font-size: 16px;
1616
width: 100%;
17-
min-width: 100%;
18-
min-height: 100%;
17+
min-width: calc(var(--modal-min-width) * (1 - var(--modal-label-ratio)));
18+
min-height: var(--modal-row-min-height);
1919
padding: 6px;
2020
vertical-align: top;
2121
resize: both;

0 commit comments

Comments
 (0)