uiwjs / uiwjs/react-codemirror
Format the clipboard value on Paste
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
I'm using the Code Mirror to visualize and lint a list of words for the user.
My expectation is to auto-format the inserted text e.g. convert a, b, c to 3 lines of a, b and c.
I tried to use:
onPasteevent andclipboard.setData('text/plain', myData)- prevent the default paste behavior and insert my custom text instead. But eventually selection is always points to
0, 0, there is nogetCursor()interface, so I did not find how to do so - I did not find the way how to replace the entire text with my formatted one (prevent onPaste, format the new text and set it)
Is there a correct approach to do that?
Contributor guide
No contributing guide indexed for this repository
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
No source file, entry point, or test is identified in the issue. Begin by reproducing the described paste flow in the React CodeMirror integration, then define how formatted pasted text should preserve the selection and verify the behavior with a focused test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100