Skip to content

Commit c2ed7a3

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 5d21107 commit c2ed7a3

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
@@ -76,7 +76,9 @@ return $.widget( "ui.calendar", {
7676
// TODO Exclude clicks on lead days or handle them correctly
7777
// TODO Store/read more then just date, also required for multi month picker
7878
this._select( event, $( event.currentTarget ).data( "timestamp" ) );
79-
this.grid.focus( 1 );
79+
this._delay( function() {
80+
this.grid.focus();
81+
} );
8082
},
8183
"mouseenter .ui-calendar-header button": "_hover",
8284
"mouseleave .ui-calendar-header button": "_hover",
@@ -132,7 +134,9 @@ return $.widget( "ui.calendar", {
132134

133135
if ( this.date.month() !== oldMonth || this.date.year() !== oldYear ) {
134136
this.refresh();
135-
this.grid.focus( 1 );
137+
this._delay( function() {
138+
this.grid.focus();
139+
} );
136140
}
137141

138142
this._setActiveDescendant();

ui/datepicker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ var widget = $.widget( "ui.datepicker", {
119119
clearTimeout( this.closeTimer );
120120
this._delay( function() {
121121
this.open( event );
122-
this.calendarInstance.grid.focus( 1 );
122+
this._delay( function() {
123+
this.calendarInstance.grid.focus();
124+
} );
123125
}, 1 );
124126
break;
125127
}

0 commit comments

Comments
 (0)