bitovi / bitovi/syn

syn.type("[enter]") not working in contenteditable div

Open
#160 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.