Improved behavior of suggestions
authorAlexander Ebert <ebert@woltlab.com>
Thu, 14 Feb 2013 17:45:49 +0000 (18:45 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 14 Feb 2013 17:45:49 +0000 (18:45 +0100)
wcfsetup/install/files/js/WCF.js

index 015489fae22e34634c0ca587cde2c50ae2f22cb0..4eceda26503c9bb63280c9ae61b1f5512c2967f7 100755 (executable)
@@ -4897,7 +4897,10 @@ WCF.Search.Base = Class.extend({
                this._list.parent().addClass('dropdownOpen');
                WCF.Dropdown.setAlignment(undefined, this._list);
                
-               WCF.CloseOverlayHandler.addCallback('WCF.Search.Base', $.proxy(function() { this._clearList(true); }, this));
+               WCF.CloseOverlayHandler.addCallback('WCF.Search.Base', $.proxy(function() { this._clearList(); }, this));
+               
+               // pre-select first item
+               this._selectNextItem();
        },
        
        /**
@@ -6872,7 +6875,7 @@ WCF.EditableItemList = Class.extend({
         * @param       object          event
         */
        _keyDown: function(event) {
-               if (event === null || (event.which === 13 || event.which === 188)) {
+               if (event === null || event.which === 188) {
                        var $value = $.trim(this._searchInput.val());
                        if ($value === '') {
                                return true;