]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Fix for #5154
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 10 Feb 2010 15:05:35 +0000 (15:05 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 10 Feb 2010 15:05:35 +0000 (15:05 +0000)
ui/jquery.ui.autocomplete.js

index 78ac1f8b52c651dc7fca55aba618aed8bf30907a..45abb17b9152ef33f946f473f13bb995b53bf68b 100644 (file)
@@ -240,6 +240,7 @@ $.widget( "ui.autocomplete", {
                $.each( items, function( index, item ) {
                        self._renderItem( ul, item );
                });
+               this.menu.deactivate();
                this.menu.refresh();
                this.menu.element.show();
                if ( ul.width() <= this.element.width() ) {
@@ -255,12 +256,15 @@ $.widget( "ui.autocomplete", {
        },
 
        _move: function( direction, event ) {
+               console.log("move " + direction + " with event " + event)
                if ( !this.menu.element.is(":visible") ) {
+                       console.log("move, menu not visible")
                        this.search( null, event );
                        return;
                }
                if ( this.menu.first() && /^previous/.test(direction) ||
                                this.menu.last() && /^next/.test(direction) ) {
+                                       console.log("move, first or last")
                        this.element.val( this.term );
                        this.menu.deactivate();
                        return;