mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 14:14:17 +08:00
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:
parent
b8d67a42bd
commit
7022e4b9ca
@ -164,6 +164,7 @@ const SkillDocEditor: FC = () => {
|
||||
)}
|
||||
{isCodeOrText && (
|
||||
<CodeFileEditor
|
||||
key={activeTabId}
|
||||
language={language}
|
||||
theme={isMounted ? theme : 'default-theme'}
|
||||
value={currentContent}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user