mdx-editor / mdx-editor/editor
[BUG] Undo/redo state is immutable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
- I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- I have read the documentation and cannot find an answer.
Describe the bug
I can't figure out how to reset undo/redo. I'm using MDXEditor with doc browser and clicking a doc opens it in the editor. I have tried to create a separate ref for each doc but nothing seems to reset undo/redo state.
Reproduction
Re-render MDXEditor with different ref or key, and undo/redo state stays.
Expected behavior
I'd love to have editorsRef.current.reset() or something similar to reset everything.
Desktop (please complete the following information):
- OS: MacOS (latest)
- Browser: Chrome (latest)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the MDXEditor entry point and trace the undo/redo history used when a document ref or key changes. Reproduce the doc-browser scenario, then verify that switching documents can reset history through the requested editorsRef.current.reset()-style API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100