Ticket #7322 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

Datepicker: Year selector disappears after setting an option in Firefox

Reported by: ThiefMaster Owned by:
Priority: blocker Milestone: 1.8.13
Component: ui.datepicker Version: 1.8.12
Keywords: Cc:
Blocking: Blocked by:

Description

1.8.12 introduced a bug breaking the year selector when setting an option after creating the datepicker.

Here's a minimal testcase:  http://jsfiddle.net/ThiefMaster/XqT5H/1/

Change History

comment:1 Changed 4 years ago by utkarsh

On Windows 7, this bug exists on Firefox 4, but not on Chrome 11 or Opera.

comment:2 Changed 4 years ago by scott.gonzalez

  • Priority changed from minor to blocker
  • Status changed from new to open
  • Summary changed from Year selector disappears after setting an option to Datepicker: Year selector disappears after setting an option in Firefox

comment:3 Changed 4 years ago by MatrixFrog

I'm not familiar with the JQuery UI code at all, but using the Firebug debugger, I found that this line (line 7822, near the top of _updateDatePicker) is when the dropdown actually disappears:

inst.dpDiv.empty().append(this._generateHTML(inst));

Also possibly worth noting is that if you set a breakpoint at that line, it will hit it twice, first from _setDateDatepicker and then again from _updateDatepicker. The second time is the one that makes the year dropdown go away.

Hopefully this is enough of a starting point to help someone fix this...

comment:4 Changed 4 years ago by gplocke

The issue seems to be happening only in Firefox, and is caused by the _updateDatepicker method being called twice. Removing the duplicate call seems to fix the problem.

Fix for this is provided with pull request:  https://github.com/jquery/jquery-ui/pull/210

The original commit is here:  https://github.com/gplocke/jquery-ui/commit/f3ee592c283bacdf9b0de50f23eca2cc038a2b42

Last edited 4 years ago by gplocke (previous) (diff)

comment:5 Changed 4 years ago by Garrison Locke

  • Status changed from open to closed
  • Resolution set to fixed

Datepicker: Removed duplicate call to _updateDatepicker when changing option in Firefox. Fixed #7322 - datepicker: Year would disappear when changing option.

Changeset: a645630ebaf02febb19a5c9e28f1e46401f07ed0

comment:6 Changed 4 years ago by Garrison Locke

Datepicker: Removed duplicate call to _updateDatepicker when changing option in Firefox. Fixed #7322 - datepicker: Year would disappear when changing option. (cherry picked from commit a645630ebaf02febb19a5c9e28f1e46401f07ed0)

Changeset: 3edda96f2a65a5c9544eab2b736dcd8b84edd8db

comment:7 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.13

comment:8 Changed 4 years ago by ThiefMaster

Unfortunately this does not fully fix the issue.

See  http://jsfiddle.net/ThiefMaster/XqT5H/7/ for a case where it still bugs when setting an option right after creating the datepicker.

It does work when invoking the option "call" inside a zero-delay setTimeout callback though.. very odd.

Last edited 4 years ago by ThiefMaster (previous) (diff)

comment:9 Changed 4 years ago by gnarf

  • Status changed from closed to reopened
  • Resolution fixed deleted

Confirming that  http://jsfiddle.net/gnarf/XqT5H/8/ in Firefox 4 is still broken

Last edited 4 years ago by gnarf (previous) (diff)

comment:10 Changed 4 years ago by Andrew Powell

  • Status changed from reopened to closed
  • Resolution set to fixed

Datepicker: removed conditional mozilla browser check block. Fixes #7322 - Year selector disappears after setting an option in Firefox

Changeset: a6227be2c09da2c698ee6d5251ac113b90585522

comment:11 Changed 4 years ago by Andrew Powell

Datepicker: removed conditional mozilla browser check block. Fixes #7322 - Year selector disappears after setting an option in Firefox (cherry picked from commit a6227be2c09da2c698ee6d5251ac113b90585522)

Changeset: 10fa7f9ae9ea68ac11795862a2ccdc813256eb8e

comment:12 Changed 3 years ago by rdworth

#6847 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.