feat: set the edge as the data source to achieve two-way linkage betw… (#1299)

### What problem does this PR solve?

feat: set the edge as the data source to achieve two-way linkage between
the edge and the to field. #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-27 18:09:02 +08:00
committed by GitHub
parent 5a1e01d96f
commit 840e921e96
5 changed files with 49 additions and 41 deletions

View File

@ -11,10 +11,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
const updateNodeInternals = useUpdateNodeInternals();
const form = Form.useFormInstance();
const options = useBuildCategorizeToOptions();
const { handleSelectChange } = useHandleToSelectChange(
options.map((x) => x.value),
nodeId,
);
const { handleSelectChange } = useHandleToSelectChange(nodeId);
return (
<>
@ -64,7 +61,9 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
<Select
allowClear
options={options}
onChange={handleSelectChange}
onChange={handleSelectChange(
form.getFieldValue(['items', field.name, 'name']),
)}
/>
</Form.Item>
</Card>