Safari displays the current date as default value when passing no value to a input type="date"
. This is the default behavior.
Using ion-input type="date"
with no value in light mode in Safari, it displays the current date in black color, making it look like as if it already has a valid value, even though it is empty.
When using a native input type="date"
Safari also displays the current date as default value, but in gray color and appears like a normal placeholder.
Stackblitz example: Ionic Docs Example - StackBlitz
I haven’t found a way to style the placeholder of the ion-input type="date"
field. So far, nothing seems to work.
ion-input {
--placeholder-color: blue;
--placeholder-opacity: 0.25;
}
This works for a ion-input type="text"
field, but not for the date
field.
Any ideas?