mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 12:39:01 +08:00
feat: use useUpdateNodeInternals to solve the issue that the newly ad… (#1287)
### What problem does this PR solve? feat: use useUpdateNodeInternals to solve the issue that the newly added anchor points cannot be connected. #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
038ca8c0ea
commit
a943aefa4d
@ -1,5 +1,6 @@
|
||||
import { CloseOutlined } from '@ant-design/icons';
|
||||
import { Button, Card, Form, Input, Select, Typography } from 'antd';
|
||||
import { useUpdateNodeInternals } from 'reactflow';
|
||||
import { useBuildCategorizeToOptions, useHandleToSelectChange } from './hooks';
|
||||
|
||||
interface IProps {
|
||||
@ -7,6 +8,7 @@ interface IProps {
|
||||
}
|
||||
|
||||
const DynamicCategorize = ({ nodeId }: IProps) => {
|
||||
const updateNodeInternals = useUpdateNodeInternals();
|
||||
const form = Form.useFormInstance();
|
||||
const options = useBuildCategorizeToOptions();
|
||||
const { handleSelectChange } = useHandleToSelectChange(
|
||||
@ -21,6 +23,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
|
||||
const handleAdd = () => {
|
||||
const idx = fields.length;
|
||||
add({ name: `Categorize ${idx + 1}` });
|
||||
if (nodeId) updateNodeInternals(nodeId);
|
||||
};
|
||||
return (
|
||||
<div
|
||||
|
Loading…
x
Reference in New Issue
Block a user