Inline editors had been not initialized properly
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 May 2022 15:27:59 +0000 (17:27 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 May 2022 15:27:59 +0000 (17:27 +0200)
wcfsetup/install/files/js/WCF.js

index 1502ba029ef672001aa87c477cf96ae8b6e37c86..d49fe2188d350a1696f6ddca960d75572ca77bf8 100755 (executable)
@@ -5700,13 +5700,22 @@ if (COMPILER_TARGET_DEFAULT) {
                                }
                                
                                this._dropdowns[$elementID] = $('<ul class="dropdownMenu" />').insertAfter($trigger);
+                       }
+
+                       this._dropdowns[$elementID].empty();
 
+                       // Some implementations override the `_show()` method to create the
+                       // drop-down menus themselves, but do not register the element id.
+                       if (!this._dropDownIdToElementId.has($elementID)) {
+                               if ($trigger === null) {
+                                       $trigger = this._getTriggerElement(this._elements[$elementID]);
+                               }
+                               
                                this._dropDownIdToElementId.set(
                                        $trigger.parent().wcfIdentify(),
                                        $elementID,
                                );
                        }
-                       this._dropdowns[$elementID].empty();
                        
                        // validate options
                        var $hasOptions = false;