w3c / w3c/edit-context

Should textformatupdate be fired with empty formats array when EditContext is deactivated?

Open
#138 0 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

Usually, when a composition is ended, textformatupdate is fired with an empty array of formats.

However, if an EditContext is deactivated while there is a composition happening (e.g. by calling blur() on the associated element) then just a compositionend event is fired and there is no textformatupdate (https://w3c.github.io/edit-context/#dfn-deactivate-an-editcontext). So web apps may end up with leftover styling from the composition after it has ended, unless they explicitly clear the formatting in the compositionend handler. So I think it would be better to also fire a textformatupdate with an empty array of TextFormats in deactivate-an-editcontext (if there is an active composition and it has text formatting).

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 deactivate-an-editcontext definition in the linked EditContext specification and compare its current event behavior with the issue's composition scenario. Confirm whether an active, formatted composition should also produce textformatupdate with an empty TextFormats array, and update the specification so the deactivation behavior is explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.