Skip to main content

Search and Top Navigation

#8059 closed bug (duplicate)

Opened January 25, 2012 08:18PM UTC

Closed January 25, 2012 09:17PM UTC

Last modified January 25, 2012 09:17PM UTC

UI Error with multiple datepicker controls

Reported by: rephistorch Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.17
Keywords: Cc:
Blocked by: Blocking:

A coworker of mine found what appears to be a bug in the jQuery UI Datepicker control. I was able to reproduce it after reducing the code to its simplest state. After additional testing, the error is as follows:

If you have multiple inputs on a page that are turned into datepicker controls, something quirky can happen if you use the showOn: "button" option. Depending on whether or not you have buttonImageOnly set to true, a couple of things can happen when switching between the different controls on the page. Here is a sample page:

The first and second examples are the same except in one way. In the first example buttonImageOnly is set to true, and in the second, it's set to false.

Example 1

This has been tested and confirmed in IE 9, and the latest releases of Firefox, and Chrome

If you click on Date 2's button image, do not select a date, and afterwards click Date 1's button image, the datepicker window will not close. You can click on the page, highlight other text, etc. As long as you don't click on another datepicker button, the popup will not close. To close it, one must either pick a different datepicker button, or use the following procedure:

  • Click on a date.
  • At this point, you're still not quite there. You can select multiple dates, and the text box will continue to update, but the popup will still never close.
  • Click on Date 1's button again.
  • The popup will now close on the next selection, or if you leave the field, as it should.

Example 2

This test case is reproducible in Firefox and IE 9. I can occasionally reproduce this in Chrome, but not always, and the error doesn't behave the same way.

In IE and Firefox, this error is exactly the same as Example one, but with Dates 3 and 4.

In chrome this bug will occasionally manifest, but when it does, the popup 'will' disappear if you click out of it. However, if you click on a date, it then gets stuck. This may be difficult to debug due to its inconsistent nature, but I'm sure a fix for the other issue should probably resolve this one.

Final Example

In all tested browsers:

If you click on any three date buttons in a row, this error does not occur.

In IE and Firefox:

This error still occurs if you select one date from the first example, and another date from the second.

In Chrome:

Again, a special case. It appears that if your first date is in the first example, and your second date is in the second example, this error may not occur. However, if your first date is in the second example and the second date is in the first, the error does occur.

Final Thoughts

I was not able to reproduce this issue if the showOn option was left in its default state; it appears to only affect showOn:"button". It is therefore my belief that the issue lies somewhere within the code to display the calendar upon a click of the calendar button. It almost seems as if a reference to an old object is never cleared, but after the 3 click example, I'm not so sure anymore.

Attachments (0)
Change History (2)

Changed January 25, 2012 09:17PM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Changed January 25, 2012 09:17PM UTC by scottgonzalez comment:2

Duplicate of #8011.