From: Matthias Schmidt Date: Sun, 17 Jan 2021 12:31:09 +0000 (+0100) Subject: Fix `Ui/ItemList` for textareas X-Git-Tag: 5.4.0_Alpha_1~433 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2712272052b36e8e6ad33d35b241f17d605b71b3;p=GitHub%2FWoltLab%2FWCF.git Fix `Ui/ItemList` for textareas `parentElement` is no longer `element.parentNode` as `element` has been repositioned. --- diff --git a/ts/WoltLabSuite/Core/Ui/ItemList.ts b/ts/WoltLabSuite/Core/Ui/ItemList.ts index 8d3de3b4a3..d107695b31 100644 --- a/ts/WoltLabSuite/Core/Ui/ItemList.ts +++ b/ts/WoltLabSuite/Core/Ui/ItemList.ts @@ -85,7 +85,7 @@ function createUI(element: ItemListInputElement, options: ItemListOptions): UiDa if (element.nodeName === "TEXTAREA") { const inputElement = document.createElement("input"); inputElement.type = "text"; - parentElement.insertBefore(inputElement, element); + element.parentNode!.insertBefore(inputElement, element); inputElement.id = element.id; element.remove(); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js index ab625545f4..84969cab6d 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js @@ -76,7 +76,7 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Traverse", "../Languag if (element.nodeName === "TEXTAREA") { const inputElement = document.createElement("input"); inputElement.type = "text"; - parentElement.insertBefore(inputElement, element); + element.parentNode.insertBefore(inputElement, element); inputElement.id = element.id; element.remove(); element = inputElement;