fix: check compatiblity after delete selecor
This commit is contained in:
@@ -10,12 +10,14 @@ interface LabelSelectorProps {
|
||||
description?: React.ReactNode;
|
||||
onChange?: (labels: Record<string, any>) => void;
|
||||
onBlur?: (e: any, type: string, index: number) => void;
|
||||
onDelete?: (index: number) => void;
|
||||
}
|
||||
|
||||
const LabelSelector: React.FC<LabelSelectorProps> = ({
|
||||
labels,
|
||||
onChange,
|
||||
onBlur,
|
||||
onDelete,
|
||||
label,
|
||||
btnText,
|
||||
description
|
||||
@@ -90,6 +92,7 @@ const LabelSelector: React.FC<LabelSelectorProps> = ({
|
||||
onLabelListChange={handleLabelListChange}
|
||||
onPaste={handleOnPaste}
|
||||
onBlur={onBlur}
|
||||
onDelete={onDelete}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ interface LabelSelectorProps {
|
||||
onChange?: (labels: Record<string, any>) => void;
|
||||
onPaste?: (e: any, index: number) => void;
|
||||
onBlur?: (e: any, type: string, index: number) => void;
|
||||
onDelete?: (index: number) => void;
|
||||
description?: React.ReactNode;
|
||||
}
|
||||
|
||||
@@ -24,6 +25,7 @@ const Inner: React.FC<LabelSelectorProps> = ({
|
||||
onLabelListChange,
|
||||
onPaste,
|
||||
onBlur,
|
||||
onDelete,
|
||||
label,
|
||||
btnText,
|
||||
description
|
||||
@@ -69,6 +71,7 @@ const Inner: React.FC<LabelSelectorProps> = ({
|
||||
list.splice(index, 1);
|
||||
onLabelListChange(list);
|
||||
updateLabels(list);
|
||||
onDelete?.(index);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -16,6 +16,7 @@ interface ListInputProps {
|
||||
labelExtra?: React.ReactNode;
|
||||
onChange: (data: string[]) => void;
|
||||
onBlur?: (e: any, index: number) => void;
|
||||
onDelete?: (index: number) => void;
|
||||
}
|
||||
|
||||
const ListInput: React.FC<ListInputProps> = (props) => {
|
||||
@@ -26,6 +27,7 @@ const ListInput: React.FC<ListInputProps> = (props) => {
|
||||
description,
|
||||
onChange,
|
||||
onBlur,
|
||||
onDelete,
|
||||
btnText,
|
||||
options,
|
||||
labelExtra
|
||||
@@ -44,6 +46,7 @@ const ListInput: React.FC<ListInputProps> = (props) => {
|
||||
const valueList = _.map(values, 'value').filter((val: string) => !!val);
|
||||
setList(values);
|
||||
onChange(valueList);
|
||||
onDelete?.(index);
|
||||
};
|
||||
|
||||
const handleOnChange = (value: string, index: number) => {
|
||||
|
||||
Reference in New Issue
Block a user