Issue metadata
Sign in to add a comment
|
beforeinput is not cancelable for composition |
||||||||||||||||||||||||
Issue descriptionChrome Version: 60.0.3089.0 (Developer Build) (64-bit) OS: Linux (and possibly all OSes) What steps will reproduce the problem? (1) https://jsfiddle.net/galmacky/8v9usxts/10/ (2) Use Japanese Anthy IME. (3) Type '0' or other numbers using Anthy IME. (4) Check the console for logs. What is the expected result? cancelable returns true, and e.preventDefault() cancels composition event. What happens instead? cancelable returns false, and composition is not canceled Beforeinput cancellation is important because this is the only practical way to cancel composition as keydown / compositionstart cannot take a look at the composition data, and compostionupdate is not cancelable. chongz@, is this a known issue?
,
May 3 2017
This is intended, I meant to fill you in on this. I actually insisted beforeinput for regular compositions not be cancelable until we fully understand the consequences and have a clear use case, and the lack of cancelability is in "Level 1" spec we follow. Adding cancelability would correspond to meeting level 2 spec: http://crbug.com/714791 See https://docs.google.com/document/d/1yPZEkHl_WOPjVeilZjE1XmlyjLCe-uS7THI0SboyrMM/edit#heading=h.b8dg6x6azemh for more reasons.
,
May 3 2017
Ok, thanks for the quick replies. I'm working on a mechanism to enable the cancellation, wish I could prove the feasibility soon. FYI, the related use cases include: 1) https://bugs.chromium.org/p/chromium/issues/detail?id=692387 2) b/37444073
,
May 3 2017
For 1), I'm not sure I fully understand the problem, but in my view cancelling beforeinput is basically the same thing as editing the textbox with JS to remove the effect of the composition. In fact the latter case I think is easier to detect that we should send restartInput() than the former (because many use cases of beforeinput cancellation are actually to reinsert the input with different styling). So I don't think it's necessarily a reason to support cancellation. For 2), I was thinking we should probably add some specific input event for Enter and Backspace which seem to need special treatment, which might be sent on yukawa@'s special IME event proposal on https://b.corp.google.com/issues/37444073#comment10 . Cancelling beforeinput which contains a lot of extra text than the Enter is not that helpful, I don't think. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by chongz@chromium.org
, May 3 2017