Skip to content

Commit e311791

Browse files
authored
fix(form-field): some input types taller than plain text input (#18825)
Fixes the time, date etc. input types being taller than the plain text input by a couple of pixels due to the native input masking. Fixes #18787.
1 parent 11536e4 commit e311791

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/material/form-field/form-field-input.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,19 @@
6161
visibility: hidden;
6262
}
6363

64-
// Fixes an issue on iOS where the following input types will collapse to 1px,
65-
// if they're empty, because we've overridden their background color.
66-
// See: https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios
6764
&[type='date'],
6865
&[type='datetime'],
6966
&[type='datetime-local'],
7067
&[type='month'],
7168
&[type='week'],
7269
&[type='time'] {
70+
// Due to the native input masking these inputs can be slightly taller than
71+
// the plain text inputs. We normalize it by resetting the line height.
72+
line-height: 1;
73+
74+
// Fixes an issue on iOS where the following input types will collapse to 1px,
75+
// if they're empty, because we've overridden their background color.
76+
// See: https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios
7377
&::after {
7478
content: ' ';
7579
white-space: pre;

0 commit comments

Comments
 (0)