From: Marcel Werk Date: Tue, 28 Dec 2021 16:18:10 +0000 (+0100) Subject: Pasting in ItemList did not work X-Git-Tag: 5.4.11_dev_1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bfe4e235505f3b9f358872e86bd6bb500b804d09;p=GitHub%2FWoltLab%2FWCF.git Pasting in ItemList did not work --- diff --git a/ts/WoltLabSuite/Core/Ui/ItemList.ts b/ts/WoltLabSuite/Core/Ui/ItemList.ts index 4da547d925..a9990cd35e 100644 --- a/ts/WoltLabSuite/Core/Ui/ItemList.ts +++ b/ts/WoltLabSuite/Core/Ui/ItemList.ts @@ -210,7 +210,7 @@ function paste(event: ClipboardEvent): void { const maxLength = +element.maxLength; text.split(/,/).forEach((item) => { item = item.trim(); - if (maxLength && item.length > maxLength) { + if (maxLength !== -1 && item.length > maxLength) { // truncating items provides a better UX than throwing an error or silently discarding it item = item.substr(0, maxLength); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js index 182494b971..453d2b25a4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js @@ -191,7 +191,7 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Traverse", "../Languag const maxLength = +element.maxLength; text.split(/,/).forEach((item) => { item = item.trim(); - if (maxLength && item.length > maxLength) { + if (maxLength !== -1 && item.length > maxLength) { // truncating items provides a better UX than throwing an error or silently discarding it item = item.substr(0, maxLength); }