w3c / w3c/edit-context

Should `beforeinput` be fired for composition? If so what should the target ranges be?

Open
#133 11 comments 0 reactions 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

Currently, Chrome does not fire beforeinput for composed input for EditContext (but does for other editors) — I wonder if that is intentional or a bug… The spec as it is currently written seems to indicate that it should be.

For composed text input, we can try to infer where the composed text is, but that could easily be buggy, since there may be special formatting or it may be split across multiple pages in the case of a document editor, etc. So maybe the best solution is to just have it be an empty array, like we do for <canvas>, assuming we want to have the beforeinput at all (I think probably we do, to be consistent with contenteditable…).

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

Start by comparing Chrome's EditContext behavior with the current specification wording for beforeinput during composed text input. Examine the existing canvas behavior for target ranges and determine whether composition should fire beforeinput and use an empty array or another range representation; done requires a resolved, spec-consistent decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.