From: Tim Düsterhus Date: Tue, 25 Jul 2023 09:20:28 +0000 (+0200) Subject: Fix comma detection in Ui/ItemList/Static X-Git-Tag: 5.4.30~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c63165b002d5bfae5817ca161e3e40f32744e3b6;p=GitHub%2FWoltLab%2FWCF.git Fix comma detection in Ui/ItemList/Static This got broken during the TypeScript migration in c04fd6ce08b40262c660d38dbd491c37aed49a89. see https://www.woltlab.com/community/thread/300812-itemlist-static-separierung-per-komma-funktioniert-nicht/ --- diff --git a/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts b/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts index 1b45ab2bde..8e00e311ee 100644 --- a/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts +++ b/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts @@ -168,7 +168,7 @@ function keyDown(event: KeyboardEvent): void { * Handles the `[ENTER]` and `[,]` key to add an item to the list. */ function keyPress(event: KeyboardEvent): void { - if (event.key === "Enter" || event.key === "Comma") { + if (event.key === "Enter" || event.key === ",") { event.preventDefault(); const input = event.currentTarget as HTMLInputElement; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Static.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Static.js index 7bcc2fd84b..48f24edac9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Static.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Static.js @@ -117,7 +117,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Dom/Traverse", "../. * Handles the `[ENTER]` and `[,]` key to add an item to the list. */ function keyPress(event) { - if (event.key === "Enter" || event.key === "Comma") { + if (event.key === "Enter" || event.key === ",") { event.preventDefault(); const input = event.currentTarget; const value = input.value.trim();