Skip to content

Commit 0b082e3

Browse files
committed
Calendar: Remove usage of deprecated .focus( 1 )
Changed as proposed in jQuery UI upgrade guide: http://jqueryui.com/upgrade-guide/1.11/#deprecated-focus-n
1 parent ae77e60 commit 0b082e3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ui/calendar.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ return $.widget( "ui.calendar", {
8181
// TODO Exclude clicks on lead days or handle them correctly
8282
// TODO Store/read more then just date, also required for multi month picker
8383
this._select( event, $( event.currentTarget ).data( "timestamp" ) );
84-
this.grid.focus();
84+
this._delay( function() {
85+
this.grid.focus();
86+
} );
8587
},
8688
"mouseenter .ui-calendar-header button": "_hover",
8789
"mouseleave .ui-calendar-header button": "_hover",
@@ -137,7 +139,9 @@ return $.widget( "ui.calendar", {
137139

138140
if ( this.date.month() !== oldMonth || this.date.year() !== oldYear ) {
139141
this.refresh();
140-
this.grid.focus();
142+
this._delay( function() {
143+
this.grid.focus();
144+
} );
141145
}
142146

143147
this._setActiveDescendant();

ui/datepicker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ var widget = $.widget( "ui.datepicker", {
124124
clearTimeout( this.closeTimer );
125125
this._delay( function() {
126126
this.open( event );
127-
this.calendarInstance.grid.focus();
127+
this._delay( function() {
128+
this.calendarInstance.grid.focus();
129+
} );
128130
}, 1 );
129131
break;
130132
}

0 commit comments

Comments
 (0)