syn.type("[enter]") not working in contenteditable div
- Dominant language
- JavaScript
- Stars
- 441
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
`syn.type("[enter]", el)` does not insert a line break in a contenteditable div; it works in a textarea.
To reproduce create a page with a div like so:
Call syn.type like so:
var el = document.getElementById("elem");
syn.type("hi[enter]ho", el);
The div will contain "hiho", but not the line break. When changing the div to a textarea, it will contain the line break.
Contributor guide
Research direction
Reproduce the issue with the provided contenteditable div and the syn.type("hi[enter]ho", el) call, then compare it with the textarea behavior. Trace how syn.type handles [enter] for each element type. Done means the contenteditable div preserves a line break while existing textarea behavior continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100