From 780191e038bfb3b3381d40fe7b3f4368da8926c0 Mon Sep 17 00:00:00 2001 From: Rankin Zheng Date: Thu, 7 Dec 2023 18:31:57 +0800 Subject: [PATCH] Fix state management in ChatMark component - Removed conditions related to 'disabled' state when creating checkbox and editor widgets in the ChatMark component. - Widgets will now always preserve their original state as defined in the markdown. --- src/views/components/ChatMark/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/components/ChatMark/index.tsx b/src/views/components/ChatMark/index.tsx index 5e186ed..5e5ce42 100644 --- a/src/views/components/ChatMark/index.tsx +++ b/src/views/components/ChatMark/index.tsx @@ -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;