--- jquery-ui-autocomplete-1.11.2.js 2014-10-16 15:17:29.000000000 -0700 +++ jquery-ui-autocomplete-custom.js 2014-10-16 15:16:59.000000000 -0700 @@ -68,6 +68,16 @@ .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 ) { if ( this.element.prop( "readOnly" ) ) { suppressKeyPress = true; @@ -97,6 +107,7 @@ suppressKeyPress = true; this._keyEvent( "next", event ); break; + case keyCode.SPACE: case keyCode.ENTER: // when menu is open and has focus if ( this.menu.active ) {