w3c / w3c/edit-context

What are the most significant benefits of the EditContext API compared to hidden textarea ?

Open
#102 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
48
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I am a developer of a rich text editor engine.
I would like to know more about the advantages of EditContext API compared to contenteditable or hidden textarea.

I know that using contenteditable directly on the DOM to implement a rich text editor can lead to inconsistent data and unpredictable behavior.
So I now use a hidden textarea. I get user input by listening to beforeinput, compositionstart/compositionend and update my own text model and selection model, then render them. At the same time, by modifying the position of the textarea element, I make the IME window appear in the appropriate position.
Even when I use canvas to implement 3D art text input, I can also receive input text through a hidden textarea and then render it on the canvas.

So as of now, I'm not sure what significant benefits the EditContext API can bring me compared to hidden textarea?

Contributor guide

Open the contributing guide

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

Read the EditContext API materials alongside the issue's comparison points: contenteditable, hidden textarea, beforeinput, composition events, IME positioning, and canvas text input. Document the significant practical differences and benefits for rich text editors, and make clear when EditContext is preferable to the described hidden-textarea approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 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.