Skip to content

Commit 529c0bc

Browse files
committed
fix(form-field): unable to tap on certain types of inputs on iOS
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 0f954a0 commit 529c0bc

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
// Note that we can't use something like visibility: hidden or
4157
// display: none, because IE ends up preventing the user from
4258
// focusing the input altogether.

0 commit comments

Comments
 (0)