Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7577097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:05:54+00:00 2026-05-30T17:05:54+00:00

I use the jQuery UI Datepicker plugin and I found that if the plugin

  • 0

I use the jQuery UI Datepicker plugin and I found that if the plugin is open and the user clicks a label element setting focus to the field which the datepicker is bound to, the blur event fires, thus the datepicker fades out. This is immidiately followed by the focus event, fading the datepicker back in. However, when the blur event fires again, the datepicker dialog remains open when the input field loses focus.

My markup is quite basic:

<label>Select date <input type="text" id="datepicker" /></label>
<script type="text/javascript">$('#datepicker').datepicker(options);</script>

I reproduced the error on the jQuery UI Datepicker page by typing the following in the console:

$('h2:first').html('<label for="datepicker">Datepicker</label>');

When the datepicker is open, try clicking on the heading.

I guess I can remove the label for datepickers, and disabling the animation might help, but I want to maintain the user experience these features provide. Can anyone help me with some inspiration on how to solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:05:55+00:00Added an answer on May 30, 2026 at 5:05 pm

    I was having the exact same problem as you (in fact your question came up during my googling).

    I believe the problem is in the version of jQueryUI you are using vs what was shown in @ShadowScripter’s jsFiddle. I encountered this problem using v1.8.17 and v1.8.18, but the jsFiddle uses v1.8.16 (which doesn’t reproduce the bug). Here’s a jsFiddle which does reproduce the bug using v1.8.18.

    So I diffed v.18 against v.16, did some code swapping and found the culprit:

    In Datepicker.prototype._hideDatepicker, postProcess() is defined as:

    v1.8.18:

    var self = this;
    var postProcess = function() {
        $.datepicker._tidyDialog(inst);
        self._curInst = null;
    };
    

    v1.8.16

    var postProcess = function() {
        $.datepicker._tidyDialog(inst);
        this._curInst = null;
    };
    

    So when the label is clicked while datepicker is open, this in v.16’s postProcess() is an HTMLDivElement object while in v.18, self is a Datepicker object. _curInst is an attribute of Datepicker so the code in v.16 is assigning _curInst to the wrong object (the HTMLDivElement instead of Datepicker). This mistake gets fixed in v.18 but it introduces this “stuck open” bug.

    Simply removing self._curInst = null; from v.18 fixes the “stuck open” bug. I’m not sure what, if any, side effects this may cause, but I didn’t notice any issues during my initial testing although your results may vary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use jQuery Validation plugin to ensure what user entered positive cost_of_car in first
I use a jquery datepicker then i read it in my servlet like that:
I'm trying to use the following plugin for date picking: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html And I'm trying
i want to use jquery UI's datepicker to trigger a POST that would then
I would like to use the jQuery UI Datepicker plugin in my Rails 3
When using the jQuery UI (1.8.6) datepicker plugin and attempting to use one specific
When i use DatePicker, jQuery's UI plugin, in an existing .aspx page I get
http://jsfiddle.net/r7D2x/ I'm trying to use jQuery Datepicker on a label ( <span> ) instead
is it possible i use jquery plugin on class which is assigned to a
I use the JQuery datepicker , and the problem is that I generate the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.