fix(skill): add key prop to editors to fix content sync on tab switch

Lexical editor only uses initialConfig.editorState on mount, ignoring
subsequent value prop changes when the component is reused by React.
Adding key={activeTabId} forces React to remount editors when switching
tabs, ensuring correct content is displayed.
This commit is contained in:
yyh 2026-01-16 13:05:47 +08:00
parent b8d67a42bd
commit 7022e4b9ca
No known key found for this signature in database

View File

@ -164,6 +164,7 @@ const SkillDocEditor: FC = () => {
)}
{isCodeOrText && (
<CodeFileEditor
key={activeTabId}
language={language}
theme={isMounted ? theme : 'default-theme'}
value={currentContent}