Skip to content

Commit e3c7ce7

Browse files
authored
fix(input): Date or time types – initial value gets displayed as placeholder (#5366)
* fix(input): Date or time types – initial value would get displayed as placeholder * Improve comments in _form-components.scss Add comment to clarify purpose of value attributes * refactor: adapted comment
1 parent 5af3191 commit e3c7ce7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/components/src/styles/internal/_form-components.scss

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,20 @@ $db-min-inline-size: var(
8080
[type="month"],
8181
[type="week"],
8282
[type="time"]
83-
):not(:user-valid)::-webkit-datetime-edit {
83+
):not(
84+
:user-valid,
85+
/* we need to set those values, as the element might have an empty HTML value attribute */
86+
[value*="1"],
87+
[value*="2"],
88+
[value*="3"],
89+
[value*="4"],
90+
[value*="5"],
91+
[value*="6"],
92+
[value*="7"],
93+
[value*="8"],
94+
[value*="9"],
95+
[value*="0"]
96+
)::-webkit-datetime-edit {
8497
@content;
8598
}
8699
}

0 commit comments

Comments
 (0)