the extension snippet as below:
when finished typing using IME, console.info for the latest time is false
ViewPlugin.fromClass(
class {
decorations = Decoration.none;
update(update: ViewUpdate) {
if (!update.selectionSet && !update.docChanged) {
return;
}
// false when finished IME typing
console.info(update.transactions[0].isUserEvent('input.type.compose'));
}
})
but when add code below , the console.log for the latest is true
// document.body can be replace with any div outside of root dom
// useCapture has to be true
document.body.addEventListener('compositionend', this.bodyEnd, true);
it occurs only when compositionend listener registered with useCapture = true