From: Alexander Ebert Date: Tue, 23 Jan 2018 15:58:48 +0000 (+0100) Subject: Reset list state if suggestion was closed X-Git-Tag: 3.1.0_RC_2~10^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26199f2c15096d6231d82a4c303e164b40ad5bcf;p=GitHub%2FWoltLab%2FWCF.git Reset list state if suggestion was closed --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Input.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Input.js index 5e3fbb0f25..91a0f4d5a6 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Input.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Input.js @@ -110,24 +110,25 @@ define(['Ajax', 'Core', 'EventKey', 'Dom/Util', 'Ui/SimpleDropdown'], function(A _keyup: function(event) { // handle dropdown keyboard navigation if (this._activeItem !== null) { - if (!UiSimpleDropdown.isOpen(this._dropdownContainerId)) { - return; - } - - if (EventKey.ArrowUp(event)) { - event.preventDefault(); - - return this._keyboardPreviousItem(); - } - else if (EventKey.ArrowDown(event)) { - event.preventDefault(); - - return this._keyboardNextItem(); + if (UiSimpleDropdown.isOpen(this._dropdownContainerId)) { + if (EventKey.ArrowUp(event)) { + event.preventDefault(); + + return this._keyboardPreviousItem(); + } + else if (EventKey.ArrowDown(event)) { + event.preventDefault(); + + return this._keyboardNextItem(); + } + else if (EventKey.Enter(event)) { + event.preventDefault(); + + return this._keyboardSelectItem(); + } } - else if (EventKey.Enter(event)) { - event.preventDefault(); - - return this._keyboardSelectItem(); + else { + this._activeItem = null; } }