Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4917 closed bug (fixed)

Enter key press on popup fails if _dayOverClass td is after _currentClass td

Reported by: julian.jelfs Owned by:
Priority: minor Milestone: 1.8
Component: ui.datepicker Version: 1.7.2
Keywords: enter Cc:
Blocked by: Blocking:


If using the keyboard to select a date from the popup, you navigate into the future and then hit enter it doesn't work. This is because of the following selector:

var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);

This returns the matching tds in the order they appear in the markup not in the order that the selectors are specified, but it then goes on to use sel[0]. The end result is that if the cell you have highlighted is after the current cell, the date does not get selected but if it is before, it does. In other words, it is only possible to navigate to a date in the past using the keyboard.

A possible fix would be to change the above code to:

var sel=$("td."+$.datepicker._dayOverClass, inst.dpDiv).add($("td."+$.datepicker._currentClass,inst.dpDiv));

I have patched my local version as above and it seems to behave correctly now.

Change History (2)

comment:1 Changed 7 years ago by Jörn Zaefferer

Milestone: TBD1.8

comment:2 Changed 7 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed in r3493.

Note: See TracTickets for help on using tickets.