Ticket #4917 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

Description

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

comment:1 Changed 5 years ago by joern.zaefferer

  • Milestone changed from TBD to 1.8

comment:2 Changed 5 years ago by kbwood

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

Fixed in r3493.

Note: See TracTickets for help on using tickets.