Why need timeoutComposition on Android

const timeoutComposition = browser.android ? 5000 : -1

why drop active composition after 5 seconds of inactivity? in this 5 seconds, the user might be selecting words on mobile virtual keyboard.

Because an active composition blocks certain decorations from being applies, and Android virtual keyboards have a habit of just entering composition whenever the cursor is in a word and staying in it indefinitely. Wouldn’t selecting words on the keyboard cause further compositionupdate events, pushing the end time forward?

Maybe I couldn’t express myself clearly before.

In this 5 seconds, the user might be selecting words on mobile virtual keyboard. Before the user selects the word, composition ends and Incomplete letters input to the page. Normally, it should be the user’s choice of words to replace these incomplete letters.

What kind of virtual keyboard do you mean? One that just shows a set of words at the top, or one with a more involved selection process?