Closed chong-z closed 7 years ago
- Canceling
'deleteByComposition'
will result in duplicated text
- But this should be expected as you are canceling a deletion
This confused me at first, but I think I now understand that what you mean is that:
"Canceling 'deleteByComposition'
will result in duplicated text unless the JS code removes the text in the targetRanges from the DOM"
I think this information should be included in an example we add to the spec, maybe a note, and not to do normative text, as it sounds slightly confusing.
RESOLUTION: Yes we can do the issues 33/34 proposal for cancelable at each end of IME. https://www.w3.org/2016/09/22-webapps-minutes.html#resolution02
Background This is about replacing text. Usually we fire
'insertText'
and assume it will replace current selection, and canceling it will prevent the entire replacement. However the first'insertText'
after'compositionstart'
is non-cancelable.Proposal We should split the replacement into 1. deletion and 2. insertion for composition, and do the deletion before
'compositionstart'
.Applications
Notes
'deleteByComposition'
will result in duplicated text'deleteByComposition'
and the last'beforeinput'
will keep DOM unchangedRelated discussion https://github.com/w3c/input-events/issues/17#issuecomment-247704684