Skip to content

Commit 74c1d01

Browse files
crisbetotinayuangao
authored andcommitted
fix(form-field): unable to tap on certain types of inputs on iOS (#8543)
Fixes an issue that caused certain input types to collapse into 1px tall strips, preventing users from being to tap on them on iOS. Fixes #8001.
1 parent d04aa19 commit 74c1d01

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/lib/input/input.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@
3737
display: none;
3838
}
3939

40+
// Fixes an issue on iOS where the following input types will collapse to 1px,
41+
// if they're empty, because we've overridden their background color.
42+
// See: https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios
43+
&[type='date'],
44+
&[type='datetime'],
45+
&[type='datetime-local'],
46+
&[type='month'],
47+
&[type='week'],
48+
&[type='time'] {
49+
&::after {
50+
content: ' ';
51+
white-space: pre;
52+
width: 1px;
53+
}
54+
}
55+
4056
@include input-placeholder {
4157
// Delay the transition until the label has animated about a third of the way through, in
4258
// order to prevent the placeholder from overlapping for a split second.

0 commit comments

Comments
 (0)