mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Fix minor bug in ArrayInput
This commit is contained in:
@@ -16,11 +16,14 @@ const ArrayInput = ({label, ...props}) => {
|
|||||||
function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {
|
function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {
|
||||||
if (event.key === "Enter" || event.key == "Tab" || event.key === ",") {
|
if (event.key === "Enter" || event.key == "Tab" || event.key === ",") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
let trimmedValue = newElementValue.trim();
|
|
||||||
if (trimmedValue !== "") {
|
newElementValue
|
||||||
arrayHelpers.push(trimmedValue);
|
.split(",")
|
||||||
setNewElementValue("");
|
.map((value) => value.trim())
|
||||||
}
|
.filter((value) => value !== "")
|
||||||
|
.forEach((value) => arrayHelpers.push(value));
|
||||||
|
|
||||||
|
setNewElementValue("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user