This commit is contained in:
r888888888
2013-06-21 11:48:58 -07:00
parent 451552ea7f
commit 9475be9944

View File

@@ -76,6 +76,16 @@ $.widget( "ui.autocomplete", {
.attr( "autocomplete", "off" );
this._on( this.element, {
click: function(event) {
if ( this.menu.element.is( ":visible" ) ) {
this._value( this.term );
this.close( event );
// Different browsers have different default behavior for escape
// Single press can mean undo or clear
// Double press in IE means clear the whole form
event.preventDefault();
}
},
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.prop( "readOnly" ) ) {