mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Datepicker: Only apply the ui-state-focus
class name to one cell
This is specifically for multi month pickers. This makes the assumption that the keyboard is always interacting with the first month in a multi month calendar. The next step is to store which grid currently has focus and to base the focus logic off of that.
This commit is contained in:
parent
9ec69ccb73
commit
9bdb4783fd
@ -166,8 +166,8 @@ $.widget( "ui.datepicker", {
|
|||||||
|
|
||||||
this.grid.attr("aria-activedescendant", newId);
|
this.grid.attr("aria-activedescendant", newId);
|
||||||
|
|
||||||
activeCell.children("a").removeClass("ui-state-focus");
|
this.grid.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
|
||||||
newCell.children("a").addClass("ui-state-focus");
|
newCell.children( "a" ).addClass( "ui-state-focus" );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_createPicker: function() {
|
_createPicker: function() {
|
||||||
@ -538,6 +538,10 @@ $.widget( "ui.datepicker", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.date.adjust( "M", -this.options.numberOfMonths );
|
this.date.adjust( "M", -this.options.numberOfMonths );
|
||||||
|
|
||||||
|
// TODO: This assumes focus is on the first grid. For multi pickers, the widget needs
|
||||||
|
// to maintain the currently focused grid and base queries like this off of it.
|
||||||
|
$( this.picker ).find( ".ui-state-focus" ).not( ":first" ).removeClass( "ui-state-focus" );
|
||||||
},
|
},
|
||||||
open: function( event ) {
|
open: function( event ) {
|
||||||
if ( this.inline || this.isOpen ) {
|
if ( this.inline || this.isOpen ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user