I have a theory how I could get it to work. I’ll test it later and keep you updated
Pseudocode
// Text to apply
let tte <- undefined
textarea.onchange =>
if !tte
editDocument async =>
await delay
apply tte to text node
tte <- value;
Update: The idea didn’t work . I hadn’t known editDocument (in an asynchronous state) actually blocks the UI elements…