Feat: Use react-hook-form to synchronize the data of the categorize form to the agent node. #3221 (#5665)

### What problem does this PR solve?

Feat: Use react-hook-form to synchronize the data of the categorize form
to the agent node. #3221

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-03-05 19:43:08 +08:00
committed by GitHub
parent 4326873af6
commit a54843cc65
5 changed files with 73 additions and 61 deletions

View File

@ -65,12 +65,15 @@ const FormSheet = ({
const { t } = useTranslate('flow');
const { handleValuesChange } = useHandleFormValuesChange(node?.id);
const { handleValuesChange } = useHandleFormValuesChange(
operatorName,
node?.id,
form,
);
useEffect(() => {
if (visible) {
if (visible && !form.formState.isDirty) {
if (node?.id !== previousId.current) {
// form.resetFields();
form.reset();
form.clearErrors();
}