The composing property of EditorView may be incorrect within the handleTextInput method

handleTextInput: (view, from, to, text) => {
    console.log(view.composing, from, to, text)
    return false
}

When I’m using the input method, I try to get view.composing, and it always returns true.

This shouldn’t be correct. When the user finishes typing, view.composing should return false. Otherwise, developers cannot determine whether the user has finished inputting.

PixPin_2025-11-26_15-48-46


It’s worth noting that when I use setTimeout to retrieve view.composing, it works normally.

handleTextInput: (view, from, to, text) => {
    setTimeout(() => {
        console.log(view.composing, from, to, text)
    })
    return false
}

PixPin_2025-11-26_15-51-56

That flag is cleared when the browser fires a compositionend event. The text input (generally coming in via DOM mutation’s being detected by a mutation handler) happens before that, at which point the library doesn’t yet know that the composition is ending.