3

We have a strange issue with pickadate.js v3.5.6., jQuery v3.3.1 When a user clicks on the element it opens the calander and call the close event in the same time. But if the user select a different tab in the browser and then return to the first tab, the calander is in open state. This is a new issue in an existing page. After the mouse click and the open / close, the element class is:

field a-picker picker__input valid picker__input--target

This is the setup:

        $('#monitor-time-days-picker').pickadate({
        format: 'dd.mm.yyyy',
        onSet: function () {
        }
    });

Has anyone experienced similar issue?

Thanks

Ehud Grand
  • 3,501
  • 4
  • 33
  • 52
  • Yeah, it basically show datepicker on click, and then update it to have focused classes, – Sanuj Dec 14 '20 at 13:30

4 Answers4

1

i'm facing the same problem on an existing website, with chrome (and only chrome).

Since yesterday, when i click an input with pickadate, it opens and closes in the same time.

I'm using jquery-3.2.1.

$('.datepicker').pickadate({
    closeOnSelect: true,
    onClose: function() {
        $('.datepicker').blur();
        $('.picker').blur();
    },
    min: new Date(),
    selectMonths: true,
    selectYears: 15
});

Before yesterday, this code works without any problem.

Alan
  • 11
  • 1
1

Same issue here, since yesteray with jquery 3.1.0 is happening the same in a working website and only with chrome for pc (working well on mobile). Issue fixed with jquery 2.2.3

1

found the solution: simply upgrade to pickadate version 3.6.2

Edit:

Please view this issue in the plugin page:

https://github.com/chingyawhao/materialize-clockpicker/issues/40

Ehud Grand
  • 3,501
  • 4
  • 33
  • 52
1

I found a solution.

<input type="text" id="myDate" onfocus="openMyDate();">

function openMyDate() {
    //delay 
    var delayInMilliseconds = 200;

    //after the delay
    setTimeout(function () {
        //if myDate did not open then trigger click
        if (!$("#myDate_root").hasClass("picker--opened")) {
            $("#myDate").trigger("click");
        }
    }
}