Re: [w3c/uievents] specify how compositionend works if the caret has been moved to a different element (#5)

Not sure how dead this is, but since it's still open I guess my input might at some point be useful.

I (editor implementer, ProseMirror and CodeMirror) do _not_ in fact want to isolate IME-in-progress from my document model. As in, I want IME changes to be treated like normal changes and have my user interface respond to them right away, not just when the composition finishes. The isolating model is what CodeMirror started with, and users found it surprising that things like autocompletion or context-dependent menus lagged behind during composition (reflecting the pre-composition state all the way until the composition was committed).

So my problem is not one of needing a hack to move the selection somewhere at compositionstart, but rather of being able to touch the DOM around a composition without canceling/clearing the composition. I'd like to be able to continue highlighting syntax or doing other kinds of styling during composition, which may involve adding an inline parent node around the text at the cursor or moving it into a new parent, or splitting it in two, and then resetting the selection to the corresponding position in the changed DOM.

I realize it's not likely that this'll be possible on any kind of short term, but ideally, for me, browsers would be 'robust' around DOM changes during composition—even if the DOM is modified and the selection changed, if the _textual_ content around the new selection corresponds to what it used to be before the script messed with the document, a composition should be able to continue. That does raise some questions (like false positives when the selection was actually moved but its new context resembles the old) and might require new APIs, so consider it just a crude sketch of what I'd need.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/5#issuecomment-438608446

Received on Wednesday, 14 November 2018 10:09:46 UTC