A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

[Proposal] EditContext API

gked
2019-06-20

EditContext API was inspired by discussions in Editing TF. It allows web applications a deeper integration with operating systems’ input services. The proposed design allows for clean separation of document object model and data model and a number of other benefits that are not available to a web developer today.

Some of the gaps that the proposal aims to fill in the web platform:

  • Very hard to build interoperable text editor on the web using browser primitives, i.e. contenteditable or textarea;
  • Contenteditable: document object and data models are coupled together;
  • Selection problems when hidden text area approach is used which may result in software keyboard or a IME candidate window to be wrongly positioned;
  • IME related issues, specifically, long running IME composition on collaboration scenarios;

It provides: Native like(how it is done in the browser today) set of Javascript APIs to control text entry through interaction with system’s text input services.

It is great for: Javascript editing frameworks.

You can find additional information in the explainer.

travisleithead
2019-06-24

I think this is a great and potentially revolutionary idea, but I’m pretty heavily biased in this space. :wink: Having had to work with (and around) contenteditable, as well as the various proposal to try to stop or prevent the browser from taking actions based on user’s typing (e.g., the cancelable input event) over the years, I think this new idea has a lot of potential benefits. Hopeful to see others in this community take a look and leave feedback!

NavidZ
2019-09-02

Chrome is also certainly interested in having similar functionalities and we have been collaborating with MS folks on this. +1 from our side.

gztchan
2019-11-04

Most of issues in the real word indicate that input is the most terrible part of content editing, because KeyEvent(s) is not reliable. Different platforms have their own implementations and unknown issues. EditContext API looks like a good cure for them.

DingTalk engineers are willing to give a help for this. :+1: