Replies: 1 comment
-
It's by design. It can confirm sync will only happen by one direction. Which means if change comes from codemirror, milkdown will be synced and this sync won't trigger another sync to codemirror, to prevent a infinite loop. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Look at the
<OnlineEditor ref={milkdownRef} content={md} onChange={milkdownListener} />
its havemilkdownRef
https://github.com/Saul-Mirone/milkdown/blob/main/website/component/Demo/Demo.tsx#L73
but in
milkdownListener
codeMirrorRef is used:https://github.com/Saul-Mirone/milkdown/blob/main/website/component/Demo/Demo.tsx#L52
As the result:
but if I fix this issue executing this
current.update(markdown);
will loop listener for changes here:https://github.com/Saul-Mirone/milkdown/blob/main/website/component/MilkdownEditor/editor.ts#L35
Beta Was this translation helpful? Give feedback.
All reactions