mdx-editor / mdx-editor/editor

[BUG] Undo/redo state is immutable

Open
#557 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.