From 2712272052b36e8e6ad33d35b241f17d605b71b3 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 17 Jan 2021 13:31:09 +0100 Subject: [PATCH] Fix `Ui/ItemList` for textareas `parentElement` is no longer `element.parentNode` as `element` has been repositioned. --- ts/WoltLabSuite/Core/Ui/ItemList.ts | 2 +- wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1