It guess it makes sense to do this. I can't think on any use case in
which the user would want to keep clicking on random dates on an open
calendar. It could be helpful if it were a filter for some
visualization, but in that case we should probably have a config to
keep the calendar always open.
Bug: T114942
Change-Id: I1c81464a1835eb488a75920334a3cf3b92ef34fc
focusout: this.onBlur.bind( this )
} );
this.calendar.$element.on( {
+ click: this.onCalendarClick.bind( this ),
keypress: this.onCalendarKeyPress.bind( this )
} );
this.$handle.on( {
}
};
+ /**
+ * Handle calendar click events.
+ *
+ * @private
+ * @param {jQuery.Event} e Mouse click event
+ */
+ mw.widgets.DateInputWidget.prototype.onCalendarClick = function ( e ) {
+ if (
+ !this.isDisabled() &&
+ e.which === 1 &&
+ $( e.target ).hasClass( 'mw-widget-calendarWidget-day' )
+ ) {
+ this.deactivate();
+ this.$handle.focus();
+ return false;
+ }
+ };
+
/**
* Handle text input enter events.
*