JQuery UI Datepicker will not close when double clicked

Demo

Played in Chrome 18 on Ubuntu, Chrome Mac, and more.

Just double-click the link, then select a date. Datpicker becomes open. How to fix it?

I wanted to check if the calendar is open before showing it again, but I cannot see the property for this .

HTML

<a href="#">double click me</a><input/>​

Js

$('input').datepicker();
$('a').click(function() {
    $('input').datepicker('show');
});​

There seems to be a problem with the default fade animation. If you open it twice before the fade ends, a problem occurs. Installing durationin 0fixes the problem, but I kind of like fade animation.


I sent an error report. Actually a hoax .

+3
source share
3 answers

Ticket # 8174. , jQuery.

0
$('input').datepicker();
$status = true;
$('a').click(function() {
    if ($status){
        $('input').datepicker('show');
            $status = false;
    }
    else{
    $('input').datepicker('hide');
        $status = true;
    }    
});

, .

+2

Perhaps something like this?

$('a').dblclick(function() {
    if ($('input').datepicker('widget').is(':visible')) {
        $('input').datepicker('hide');
    }
});​
0
source

All Articles