uiwjs / uiwjs/react-codemirror

Can not select all text if editable={false}

Open
#252 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

I have this code in the app for user to copy the code snippet, but I do not want the user to accidentally edit the code. I added editable={false} to the <CodeMirror /> component. But when I press cmd+A or ctrl+A, I couldn't select the text within the component.

            <CodeMirror
              editable={false}
              extensions={[html()]}
              width="100%"
              height="250px"
              value={`123123123123123`}
              style={{
                fontSize: '14px',
              }}
            />

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

Reproduce the behavior with the shown configuration, starting from the editable={false} option and the editor's selection handling. Done means Cmd+A or Ctrl+A selects all displayed text while editing remains disabled.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.