Skip close requests originating from the search drop-down itself
authorAlexander Ebert <ebert@woltlab.com>
Fri, 4 Feb 2022 13:10:58 +0000 (14:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 4 Feb 2022 13:10:58 +0000 (14:10 +0100)
wcfsetup/install/files/js/WCF.js

index cf3a3908b5dbc3e308ab6ed6e65e3194d10911eb..1502ba029ef672001aa87c477cf96ae8b6e37c86 100755 (executable)
@@ -4471,7 +4471,13 @@ WCF.Search.Base = Class.extend({
                        return;
                }
                
-               WCF.CloseOverlayHandler.addCallback('WCF.Search.Base', $.proxy(function() { this._clearList(); }, this));
+               WCF.CloseOverlayHandler.addCallback('WCF.Search.Base', (origin, identifier) => {
+                       if (origin === "dropdown" && identifier === this._searchInput[0].parentElement.id) {
+                               return;
+                       }
+
+                       this._clearList();
+               });
                
                var $containerID = this._searchInput.parents('.dropdown').wcfIdentify();
                if (!WCF.Dropdown.getDropdownMenu($containerID).hasClass('dropdownOpen')) {