Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Materialize Date Picker automatically hide after opening problem on chrome

Materialize datepicker works fine in other browsers and old versions of Google Chrome but it doesn't work properly in new version of Google Chrome

enter image description here

<input type="date" class="datepicker">

JS

$('.datepicker').pickadate({

selectMonths: true, // Creates a dropdown to control month
selectYears: 15 // Creates a dropdown of 15 years to control year
});

Codepen Link for Datepicker

like image 931
Alperen Akti Avatar asked Mar 16 '19 18:03

Alperen Akti


Video Answer


1 Answers

I had the same problem and solved like this way:

$('.datepicker').on('mousedown', function preventClosing(event) {
  event.preventDefault();
});
like image 114
Nico JL Avatar answered Sep 19 '22 19:09

Nico JL