ed07f0a
click here to add a description
click here to add a homepage
The official jQuery user interface library. — Read more
http://jqueryui.com/
This URL has Read+Write access
Autocomplete: Don't reset text field value on blur unless it will actually change the value. Fixes #5900 - Autocomplete: mousing over menu option replaces text box contents, moves caret.
@@ -153,7 +153,10 @@ $.widget( "ui.autocomplete", {
self.selectedItem = item;
},
blur: function( event, ui ) {
- if ( self.menu.element.is(":visible") ) {
+ // don't set the value of the text field if it's already correct
+ // this prevents moving the cursor unnecessarily
+ if ( self.menu.element.is(":visible") &&
+ ( self.element.val() !== self.term ) ) {
self.element.val( self.term );
}
ed07f0a