id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 14386,Unify compositable input change events,kkrzton,,"Compositable input is handled differently in different browsers which means the change event in CKEditor is also fired differently when handling compositable input. Composition events ([https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#events-compositionevents composition events w3c specs]) concerns typing in Japanese (and other languages in which typing one symbol involves more than one keystrokes) and some mobile typing (e.g. suggestions). According to tests from ticket #14329 and some additional testing: * In Blink change event is fired with every key press, it is not fired for confirmation (when enter is pressed) but it is fired more than once (two, sometimes three times - needs additional testing) when you move to new line (when enter is pressed for the second time). Change event is also fired for keys which cancels composition (backspace, delete, esc), but it is not fired when during composition editor loses focus (which means the end of composition so word/symbol is inserted). * In FF change event is fired for confirmation (when enter is pressed). For second enter press it behaves same as in Blink (two, three change events fired). Change event is also fired when canceling composition (backspace, delete, esc) - same as in Blink and losing focus during composition behaves also same as in Blink. * In IE change event is not fired for confirmation (when enter is pressed) but it is fired twice when you move to new line (when enter is pressed for the second time). IE doesn't fire any change event when handling composition. There is proposed fix for this behavior (#14329), but it also may need some unification. Native events flow differs also a little in above browsers. Most important differences: * IE8 does not support composition* and textinput event. * IE11 has a [https://connect.microsoft.com/IE/feedback/details/2322126/ie11-incorrect-number-of-keyup-events-for-enter-fired-after-inserting-japanese-symbols-inside-contenteditable-element specific bug] which won't be fixed. * Edge - after compositionend, there are no further events fired for action which caused compostionend (usually it is enter keyup event). It seems it is consistent with specs: ""During the composition session, all keydown and keyup events may be suppressed."". * Chrome fires keydown event (with key code 229) after compositionend event for enter key. In all other browsers it is keyup event with key code 13. Native event flow tested with [https://jsfiddle.net/atazsjwu/5/ this jsfiddle]. ---- Unifying change event for compositable input should result in consistent change event firing in all browsers. It seems like the best approach is to fire change event only when symbol/word is inserted (after end of composition). Also it should not be fired for keys which cancels composition. It may be achieved using [https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-compositionstart compositionstart] and [https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-compositionend compositionend] events, there is also [https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#widl-CompositionEvent-data data] attribute for those events which holds currently composed input. ---- For more ""historical"" context, see #14329.",New Feature,confirmed,Normal,,General,,,,