mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Remove unwanted keyboard shortcut
Remove shortcut for closing the calendar and erasing the date (CTRL+END). Remove unwanted CTRL+HOME shortcut and support for enter key on input.
This commit is contained in:
parent
57736406f1
commit
63bdc3ef81
@ -131,9 +131,6 @@ $.widget( "ui.datepicker", {
|
|||||||
this.close( event );
|
this.close( event );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case $.ui.keyCode.ENTER:
|
|
||||||
this.calendarInstance._handleKeydown( event );
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.DOWN:
|
case $.ui.keyCode.DOWN:
|
||||||
case $.ui.keyCode.UP:
|
case $.ui.keyCode.UP:
|
||||||
clearTimeout( this.closeTimer );
|
clearTimeout( this.closeTimer );
|
||||||
@ -142,26 +139,6 @@ $.widget( "ui.datepicker", {
|
|||||||
this.calendarInstance.grid.focus();
|
this.calendarInstance.grid.focus();
|
||||||
}, 1 );
|
}, 1 );
|
||||||
break;
|
break;
|
||||||
case $.ui.keyCode.HOME:
|
|
||||||
if ( event.ctrlKey ) {
|
|
||||||
this.valueAsDate( new Date() );
|
|
||||||
event.preventDefault();
|
|
||||||
if ( this.isOpen ) {
|
|
||||||
this.calendarInstance.refresh();
|
|
||||||
} else {
|
|
||||||
this.open( event );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $.ui.keyCode.END:
|
|
||||||
if ( event.ctrlKey ) {
|
|
||||||
this.element.val( "" );
|
|
||||||
event.preventDefault();
|
|
||||||
if ( this.isOpen ) {
|
|
||||||
this.close( event );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keyup: function() {
|
keyup: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user