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