focusout: this.onBlur.bind( this )
} );
this.calendar.$element.on( {
+ focusout: this.onBlur.bind( this ),
click: this.onCalendarClick.bind( this ),
keypress: this.onCalendarKeyPress.bind( this )
} );
// Tabbing backward from text input: normal browser behavior
} else {
// Tabbing forward from text input: just focus the calendar
- this.calendar.$element.focus();
+ this.calendar.$element.trigger( 'focus' );
return false;
}
}
if ( e.which === OO.ui.Keys.TAB ) {
if ( e.shiftKey ) {
// Tabbing backward from calendar: just focus the text input
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
return false;
} else {
// Tabbing forward from calendar: focus the text input, then allow normal browser
// behavior to move focus to next focusable after it
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
}
}
}.bind( this ) );
if ( userSelected ) {
// Prevent focusing the handle from reopening the calendar
this.closing = true;
- this.$handle.focus();
+ this.$handle.trigger( 'focus' );
this.closing = false;
}
this.textInput.toggle( true );
this.calendar.toggle( true );
- this.textInput.$input.focus();
+ this.textInput.$input.trigger( 'focus' );
};
/**
if (
!this.isDisabled() &&
e.which === 1 &&
+ // eslint-disable-next-line no-jquery/no-class-state
$( e.target ).hasClass( targetClass )
) {
this.deactivate( true );