this._updateView();
},
"mousedown .ui-calendar-calendar button": function( event ) {
- event.preventDefault();
-
this._setOption( "value", new Date( $( event.currentTarget ).data( "timestamp" ) ) );
this.refresh();
- this._trigger( "select", event );
- this.activeDescendant.closest( this.grid ).focus();
+
+ // Allow datepicker to handle focus
+ if ( this._trigger( "select", event ) !== false ) {
+ this.activeDescendant.closest( this.grid ).focus();
+ event.preventDefault();
+ }
},
"mouseenter .ui-calendar-header-buttons button": "_hover",
"mouseleave .ui-calendar-header-buttons button": "_hover",
select: function( event ) {
that.element.val( that.calendarInstance.value() );
that.close();
+ event.preventDefault();
that._focusTrigger();
that._trigger( "select", event );
+
+ return false;
}
} ) )
.calendar( "instance" );