testing-library / testing-library/user-event
copy/paste HTML elements into contenteditable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
https://codesandbox.io/p/sandbox/clever-shockley-lkdm23?file=%2Fsrc%2FApp.js%3A10%2C34
Prerequisites
1、Renders a div whose contentEditable is true
2、Using keyboard, simulate the user to copy a Heading elements
Expected behavior
The style of theHeading elements is retained
Actual behavior
Heading elements are escaped
User-event version
14.5.2
Environment
@testing-library/react@^13.4.0
@testing-library/jest-dom@^5.17.0
Additional context
No response
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 by running the linked CodeSandbox reproduction with user-event 14.5.2 and inspect how keyboard copy handles a contentEditable div containing a heading. Confirm that the copied heading retains its style rather than being escaped, then add regression coverage for the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100