4

In Firefox, input type="date" brings a calendar popup on click.Apart from preventing the default behaviour on click, I haven't found a way to hide the calendar. I don't want to use type='text' either.

Is there any way to hide this popup calendar in Firefox?

popup Image

derloopkat
  • 6,232
  • 16
  • 38
  • 45
Marcos
  • 41
  • 1
  • 2

2 Answers2

3

If you prevent the default action for the onClick handler, the popup is not shown on Firefox.

<input type="date" onClick="event.preventDefault()" />
0

There is actually no way to do it properly with css in Firefox. Instead you'll need to work with the click & focus events attached to your input.

Exemple with jQuery (can be done with vanilla JS) :

$("input[type='date']").on('click, focus', function(event) {
   event.preventDefault(); //We prevent default calendar to pop
   // YOUR CODE, show your own calendar, etc
});
ValentinV
  • 31
  • 2