Tree 的 editControls 失效问题修复

Change-Id: I7fb0385612c6eda45b386ba1dfbddac7bc37d47b
This commit is contained in:
2betop 2020-11-10 12:21:41 +08:00
parent 7359eb33fa
commit f4f29995e1

View File

@ -349,13 +349,18 @@ export class TreeSelector extends React.Component<
@autobind
handleEdit(item: Option) {
const labelField = this.props.labelField;
this.setState({
isEditing: true,
isAdding: false,
editingItem: item,
inputValue: item[labelField]
});
const {bultinCUD, onEdit, labelField, options} = this.props;
if (!bultinCUD) {
onEdit?.(item);
} else {
this.setState({
isEditing: true,
isAdding: false,
editingItem: item,
inputValue: item[labelField]
});
}
}
@autobind