fix node variable update render (#5251)

* fix node variable update render

* editor value formatted

* fix
This commit is contained in:
heheer
2025-07-18 15:48:26 +08:00
committed by GitHub
parent 530f30e3e8
commit 6f75c1b80e
12 changed files with 59 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
import type { BoxProps } from '@chakra-ui/react';
import { Box, Button, ModalBody, ModalFooter, useDisclosure } from '@chakra-ui/react';
import React from 'react';
import React, { useMemo } from 'react';
import { editorStateToText } from './utils';
import Editor from './Editor';
import MyModal from '../../MyModal';
@@ -58,6 +58,12 @@ const PromptEditor = ({
},
[onBlur]
);
const formattedValue = useMemo(() => {
if (typeof value === 'object') {
return JSON.stringify(value);
}
return value;
}, [value]);
return (
<>
@@ -70,7 +76,7 @@ const PromptEditor = ({
minH={minH}
maxH={maxH}
maxLength={maxLength}
value={value}
value={formattedValue}
onChange={onChangeInput}
onBlur={onBlurInput}
placeholder={placeholder}