diff --git a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx index 9c6084541..848a760e2 100644 --- a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx +++ b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx @@ -83,12 +83,13 @@ interface AttributeEditorProps { } export default function AttributeEditor({ note, componentId, notePath, ntxId, hidden }: AttributeEditorProps) { + const [ currentValue, setCurrentValue ] = useState(""); const [ state, setState ] = useState<"normal" | "showHelpTooltip" | "showAttributeDetail">(); const [ error, setError ] = useState(); const [ needsSaving, setNeedsSaving ] = useState(false); const lastSavedContent = useRef(); - const currentValueRef = useRef(""); + const currentValueRef = useRef(currentValue); const wrapperRef = useRef(null); const editorRef = useRef(); @@ -126,6 +127,7 @@ export default function AttributeEditor({ note, componentId, notePath, ntxId, hi } editorRef.current?.setText(htmlAttrs); + setCurrentValue(htmlAttrs); } function parseAttributes() { @@ -289,7 +291,7 @@ export default function AttributeEditor({ note, componentId, notePath, ntxId, hi className="attribute-list-editor" tabIndex={200} editor={CKEditorAttributeEditor} - currentValue="" // handled imperatively + currentValue={currentValue} config={{ toolbar: { items: [] }, placeholder: t("attribute_editor.placeholder"),