You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Textfield with type="date" shows extra calendar icon in Firefox #5795
when i used a textfield with type="date" it working correctly in firefox, but not working correctly in chrome or edge. I miss the date-picker from browser...
Can you help me?
Reproduction
Use a simple is working in firefox, but not in chrome or edge (date-picker from browser is missing).
Workaround
no content
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
// This method was just recently added, it's not published yet
// textfield.showPicker();
// You can use the shadow root in the meantime
textfield.shadowRoot.querySelector('input').showPicker();
I have also published this problem in a fork repo (material-esm/material#35 (comment)).
Treeder has a good approach, but unfortunately the solution given doesn't work for me either.
I have changed the Chrome display settings to the light theme, but the date picker is still not there.
Are you referring to the browser's <input> calendar icon that is intentionally removed?
The datepicker itself still works, but in MWC the non-Material browser <input> icons are removed in favor of using Material icon buttons. Here's a demo: https://output.jsbin.com/wayuwolabu
unfortunately your example does not work properly (I see an unspecified error in the console).
But I have a fundamental problem with this solution. In Firefox I see two icons (the original datepicker icon and the trailing icon - I had already thought of this solution a few days ago, but discarded it due to this circumstance).
Is there a way to deactivate the date picker in general and only display the trailing icon?
Date picker not opening in JS Bin might be due to this
Yes, that's why I linked to the output.jsbin.com, but outputs are only available for a short amount of time before it reverts to the edit page. You can copy/paste the same code into a new jsbin, open the external output page, and then it'll work like it normally does.
About the calendar picker indicator on Firefox, you might want to follow bug #1812397 and the related bugs mentioned at the end of the thread :)
Thanks for the links! Let's repurpose this issue to track hiding Firefox's new <input type="date"> icon once there's a CSS selector to style it.
changed the title [-]Textfield with type="date" not working correctly in chrome[/-][+]Textfield with type="date" shows extra calendar icon in Firefox[/+]on Apr 15, 2025
Now i have the problem, how i can set this style for the input elements inside the shadow of md-outlined-text-field. Have you an idea?
The only thing that surprises me is the fact that the repo of https://github.com/treeder/material has no problem with this issue. There the date-picker also works in chrome.
@asyncliz The new title irritates me a little. I continue to have the basic problem with the missing default calendar picker icon in Chrome and Edge (latest versions).
@asyncLiz The new title irritates me a little. I continue to have the basic problem with the missing default calendar picker icon in Chrome and Edge (latest versions).
I believe this is what Liz said was intentionally removed:
The browser calendar icons are removed because they don't match the Material Design spec.
In Material, the text field's icon should be interactive, show a ripple and focus ring, and match the new updated icon symbols. The browser input icons are intentionally removed so they don't clash with Material icons that are intended to be the replacement.
If this doesn't work for you, you can always create use the "field" building block component to create a text field that doesn't remove built-in browser calendar icons.
Why the icon is only removed in chrome by default and not in firefox?
That is what I re-purposed this bug for. There should not be a calendar icon in Firefox. Once the Firefox bug for an icon pseudo selector is implemented, we can add that selector to the text field's styles to remove the icon from both Chrome and Firefox:
Activity
asyncliz commentedon Apr 11, 2025
It appears to be working for me in Chrome: https://jsbin.com/rowowusafu/edit?html,output
Can you provide more info on what isn't working? You can show the picker by focusing the field and pressing the space key.
You can also add an icon button that calls
showPicker()when it's clicked.Timbuktu1982 commentedon Apr 14, 2025
Hi Liz,
unfortunately your example does not work either.
I have also published this problem in a fork repo (material-esm/material#35 (comment)).
Treeder has a good approach, but unfortunately the solution given doesn't work for me either.
I have changed the Chrome display settings to the light theme, but the date picker is still not there.
Have you another idea?
asyncliz commentedon Apr 14, 2025
Are you referring to the browser's
<input>calendar icon that is intentionally removed?The datepicker itself still works, but in MWC the non-Material browser
<input>icons are removed in favor of using Material icon buttons. Here's a demo: https://output.jsbin.com/wayuwolabuTimbuktu1982 commentedon Apr 15, 2025
Hi Liz,
unfortunately your example does not work properly (I see an unspecified error in the console).

But I have a fundamental problem with this solution. In Firefox I see two icons (the original datepicker icon and the trailing icon - I had already thought of this solution a few days ago, but discarded it due to this circumstance).

Is there a way to deactivate the date picker in general and only display the trailing icon?
HarmfulBreeze commentedon Apr 15, 2025
Date picker not opening in JS Bin might be due to this (it's about
<select>but it also applies to<input>, at least on Edge).About the calendar picker indicator on Firefox, you might want to follow bug #1812397 and the related bugs mentioned at the end of the thread :)
asyncliz commentedon Apr 15, 2025
Yes, that's why I linked to the output.jsbin.com, but outputs are only available for a short amount of time before it reverts to the edit page. You can copy/paste the same code into a new jsbin, open the external output page, and then it'll work like it normally does.
Thanks for the links! Let's repurpose this issue to track hiding Firefox's new
<input type="date">icon once there's a CSS selector to style it.[-]Textfield with type="date" not working correctly in chrome[/-][+]Textfield with type="date" shows extra calendar icon in Firefox[/+]Timbuktu1982 commentedon Apr 16, 2025
Hi,
thank you for your replies.
I have not found a general solution for Firefox, but it gives a possibility to make the icon transparent. The solution is compatible with most browsers (https://caniuse.com/mdn-css_properties_-webkit-text-fill-color).
input { -webkit-text-fill-color: black; color: transparent; }Now i have the problem, how i can set this style for the input elements inside the shadow of md-outlined-text-field. Have you an idea?
The only thing that surprises me is the fact that the repo of https://github.com/treeder/material has no problem with this issue. There the date-picker also works in chrome.
Timbuktu1982 commentedon Apr 16, 2025
@asyncliz The new title irritates me a little. I continue to have the basic problem with the missing default calendar picker icon in Chrome and Edge (latest versions).
HarmfulBreeze commentedon Apr 16, 2025
I believe this is what Liz said was intentionally removed:
Timbuktu1982 commentedon Apr 16, 2025
Ah ok, now i understand.
But why was this removed intentionally?
asyncliz commentedon Apr 21, 2025
The browser calendar icons are removed because they don't match the Material Design spec.
In Material, the text field's icon should be interactive, show a ripple and focus ring, and match the new updated icon symbols. The browser input icons are intentionally removed so they don't clash with Material icons that are intended to be the replacement.
If this doesn't work for you, you can always create use the "field" building block component to create a text field that doesn't remove built-in browser calendar icons.
Timbuktu1982 commentedon Apr 28, 2025
Hi Liz,
sorry, i didn't ask my question correctly.
Why the icon is only removed in chrome by default and not in firefox?
asyncliz commentedon Apr 28, 2025
That is what I re-purposed this bug for. There should not be a calendar icon in Firefox. Once the Firefox bug for an icon pseudo selector is implemented, we can add that selector to the text field's styles to remove the icon from both Chrome and Firefox:
material-web/textfield/internal/_input.scss
Lines 30 to 33 in 5bc1506