From 78e8a3570b9ee8add22c34700e0132353237acbc Mon Sep 17 00:00:00 2001 From: Siyuan Miao Date: Thu, 18 Sep 2025 12:51:05 +0200 Subject: [PATCH] chore: add max length for paste text --- ui/src/components/popovers/PasteModal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/components/popovers/PasteModal.tsx b/ui/src/components/popovers/PasteModal.tsx index 9f270527..52272228 100644 --- a/ui/src/components/popovers/PasteModal.tsx +++ b/ui/src/components/popovers/PasteModal.tsx @@ -15,6 +15,9 @@ import { InputFieldWithLabel } from "@components/InputField"; import { SettingsPageHeader } from "@components/SettingsPageheader"; import { TextAreaWithLabel } from "@components/TextArea"; +// uint32 max value / 4 +const pasteMaxLength = 1073741824; + export default function PasteModal() { const TextAreaRef = useRef(null); const { isPasteInProgress } = useHidStore(); @@ -141,6 +144,7 @@ export default function PasteModal() { label="Paste from host" rows={4} onKeyUp={e => e.stopPropagation()} + maxLength={pasteMaxLength} onKeyDown={e => { e.stopPropagation(); if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {