fix: can not paste a text in env vars input box

This commit is contained in:
jialin
2025-03-19 20:09:43 +08:00
parent 2ceefab18c
commit b8f58b2cc1
4 changed files with 28 additions and 53 deletions
+3 -3
View File
@@ -44,6 +44,7 @@ const LabelSelector: React.FC<LabelSelectorProps> = ({
[setLabelList]
);
const handleLabelsChange = (data: Record<string, any>) => {
console.log('handleLabelsChange', data);
setLabelsData(data);
onChange?.(data);
};
@@ -52,10 +53,9 @@ const LabelSelector: React.FC<LabelSelectorProps> = ({
e: React.ClipboardEvent<HTMLTextAreaElement>,
index: number
) => {
e.preventDefault();
const clipboardText = e.clipboardData.getData('text');
if (!clipboardText) return;
if (!clipboardText || clipboardText.indexOf('=') === -1) return;
e.preventDefault();
const lines = clipboardText
.split(/\r?\n/)