Repository navigation
Clearing editor history #945
Unanswered
MrDiamondDog
asked this question in
Q&A
Replies: 1 comment
|
I would try using rootEditor$ rather than activeEditor$ for this operation. MDXEditor exposes both through its Gurx system:
Inside a custom toolbar or plugin component running in the MDXEditor realm, you can access rootEditor$ using useCellValue and dispatch CLEAR_HISTORY_COMMAND on the resulting editor instance. The important detail is to access it after the editor is initialized, rather than assuming it is available during the initial render. Lexical's history package supports CLEAR_HISTORY_COMMAND, but I haven't verified this against your exact MDXEditor version. If you also need to clear the history of nested editors, such as table cells, those may require separate handling. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How would I clear the undo/redo history of the editor? I've tried accessing the lexical editor via
activeEditor$to dispatch theCLEAR_HISTORY_COMMAND, butactiveEditor$is always null when I try accessing it.All reactions