chore: add max length for paste text

This commit is contained in:
Siyuan Miao 2025-09-18 12:51:05 +02:00
parent 153f458beb
commit 78e8a3570b
1 changed files with 4 additions and 0 deletions

View File

@ -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<HTMLTextAreaElement>(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)) {