uiwjs / uiwjs/react-codemirror

Code Editor becomes unresponsive when 'value' prop is not empty

Open
#711 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

If 'value' prop is defined for the codemirror then following bugs occur:

  • sometimes we cannot use caret navigation for first word of code editor
  • if we delete the entire line then add just single word then editor becomes unresponsive... after that it either removes the word after like 1 min or throws the following error:

IndexSizeError
Failed to execute 'collapse' on 'Selection': The offset 4 is larger than the node's length (0).
▼ 6 stack frames were expanded.
at eval (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:2520:18
at DOMObserver.ignore (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:5690:14
at DocView.updateSelection (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:2504:26
at EditorView.update (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:6008:20
at DOMObserver.flush (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:5797:50
at MutationObserver.eval (https://slvju.csb.app/node_modules/
codemirror/view/dist/index.js:5561:263

https://github.com/user-attachments/assets/82ebf7a9-32f0-4afc-a175-ceb71f4496e2

Contributor guide

No contributing guide indexed for this repository

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 with the reproduction linked in the issue and inspect the reported CodeMirror selection stack trace. Reproduce the caret-navigation and line-editing steps with a non-empty value prop; done means the editor remains responsive and no IndexSizeError occurs.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.