In older versions of Firefox (until 109), it was possible to select the date picker's icon like in Chromium:
input[type="date"]::-webkit-calendar-picker-indicator {
display: none; /* Hides the icon in Chrome and Firefox < v109 */
}
It's no longer possible that way, see also this Codepen. Does anyone know a workaround?
My date inputs have custom icons and now show two of them in the newish Firefox versions. For now, I'm doing some user agent sniffing and add a CSS class so I can remove my custom icon:
const userAgent = navigator.userAgent;
const regex = /Firefox\/(?<majorRelease>\d+(\.\d+)?)/
const match = userAgent.match(regex)
const FirefoxVersion = match ? Number(match.groups.majorRelease) : null
if (FirefoxVersion > 108){
const inputs = document.querySelectorAll('.input[type="date"]')
inputs.forEach((el)=>{
el.classList.add('input-date-firefox-fix')
})
}
pointer-events: none;
. – Argillaceous