fix: parser multiple backend pramas on paste

This commit is contained in:
jialin
2026-03-17 16:35:55 +08:00
committed by jialin
parent 9aae2c7f50
commit 0ca055b8e8
6 changed files with 121 additions and 18 deletions
+2 -4
View File
@@ -1,3 +1,4 @@
import { parseParamsString } from '@/utils';
import _ from 'lodash';
import React, { useEffect } from 'react';
import Wrapper from '../label-selector/wrapper';
@@ -83,10 +84,7 @@ const ListInput: React.FC<ListInputProps> = (props) => {
const pastedText = e.clipboardData?.getData('text');
if (!pastedText) return;
const lines = pastedText.split(/\r?\n/).filter((line: string) => {
const trimmedLine = trim ? line.trim() : line;
return trimmedLine.length > 0;
});
const lines = parseParamsString(pastedText);
if (lines.length <= 1) {
// if there's only one line, let the default paste behavior handle it