feat: Support for Chat Flow & Agent Support for binding a single chat flow (#765)
Co-authored-by: Yu Yang <72337138+tomasyu985@users.noreply.github.com> Co-authored-by: zengxiaohui <csu.zengxiaohui@gmail.com> Co-authored-by: lijunwen.gigoo <lijunwen.gigoo@bytedance.com> Co-authored-by: lvxinyu.1117 <lvxinyu.1117@bytedance.com> Co-authored-by: liuyunchao.0510 <liuyunchao.0510@bytedance.com> Co-authored-by: haozhenfei <37089575+haozhenfei@users.noreply.github.com> Co-authored-by: July <jiangxujin@bytedance.com> Co-authored-by: tecvan-fe <fanwenjie.fe@bytedance.com>
This commit is contained in:
@@ -41,6 +41,7 @@ export const EditorFullInputInner = forwardRef<EditorHandle, EditorInputProps>(
|
||||
...restProps
|
||||
} = props;
|
||||
const [value, setValue] = useState(propsValue);
|
||||
const [isComposing, setIsComposing] = useState(false);
|
||||
|
||||
// Create a mutable reference to store the latest value
|
||||
const valueRef = useRef(value);
|
||||
@@ -104,8 +105,16 @@ export const EditorFullInputInner = forwardRef<EditorHandle, EditorInputProps>(
|
||||
value={value}
|
||||
onChange={v => {
|
||||
setValue(v);
|
||||
if (isComposing) {
|
||||
return;
|
||||
}
|
||||
propsOnChange?.(v);
|
||||
}}
|
||||
onCompositionStart={() => setIsComposing(true)}
|
||||
onCompositionEnd={e => {
|
||||
setIsComposing(false);
|
||||
propsOnChange?.(e.currentTarget.value);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user