Merge pull request #354 from devchat-ai/fix-chatmark-ui

Fix state management in ChatMark component
This commit is contained in:
Rankin Zheng 2023-12-07 18:33:36 +08:00 committed by GitHub
commit 2548b8d8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,7 +148,7 @@ const ChatMark = ({ children,value,messageDone }) => {
id,
title,
type:'checkbox',
value: disabled?'unchecked':status === 'x'?'checked':'unchecked',
value: status === 'x'?'checked':'unchecked',
});
setAutoForm(true);
} else if (match = line.match(radioRegex)) {
@ -180,7 +180,7 @@ const ChatMark = ({ children,value,messageDone }) => {
editorContentRecorder = editorContentRecorder.substring(0, editorContentRecorder.length - 1);
// apply editor content to widget
((editorId,editorContent) => widgetsHandlers.apply((item)=>{
if(item.id === editorId && !disabled){
if(item.id === editorId){
item.value = editorContent;
}
return item;