I have an autocomplete, but when I type text to search and move my mouse over autocomplete’s results, text in autocomplete changes to previous(removes). Does anyone know how to improve this behaviour.
I read in jQuery.com
focus Type: autocompletefocus
Before focus is moved to an item (not selecting), ui.item refers to
the focused item. The default action of focus is to replace the text
field’s value with the value of the focused item, though only if the
focus event was triggered by a keyboard interaction. Canceling this
event prevents the value from being updated, but does not prevent the
menu item from being focused.
but I don’t know how to cancel focus event.
You’re right, jquery autocpmplete has that bug on they own [demo page][1].
You can get it if you typed some text and autocomplete had showed some answers; then you adding some additional text and at the same time you are hovering on one of the answer the programm will cut your additional text.
You can check source code in autocomplete widget
And you can figure out you problem by commenting out this line
self.element.val(self.term);But this is not realy good idea. You can post a bug to jquery!