w3c / input-events

Input Events
https://w3c.github.io/input-events/
Other
24 stars 16 forks source link

Proposal: better encapsulation of composition events #141

Open Azmisov opened 1 year ago

Azmisov commented 1 year ago

Here is a link to my proposal. There are three API changes, with the goal being better control of composition events so that IME's can finally be predictably handled in a custom editor. Only the first API change is essential, and should be a straightforward, backwards-compatible modification that I believe can easily be implemented in current browsers.

Quick summary:

  1. compositionborder HTML attribute, signaling that compositions inside the element must only use that element's text content; also if the element has focus, the browser will not retarget the composition to an element outside
  2. requestCompositionEnd, to forcibly commit the composition if the developer knows the composition should end
  3. deleteCompositionText should revert the DOM, not just remove plaintext

@johanneswilm Not sure how you guys handle proposals around here

(See also my comment here in #134, which discusses many of the same points)

johanneswilm commented 1 year ago

@Azmisov Thanks. Yes, this looks like something that deserves to be discussed. Let me investigate how we can handle your proposal.