-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for composition events #1978
Comments
Typing and committing あ in the above test case gives: Firefox:
Chrome:
|
For what it's worth, the browser interop issue has some discussion at: It would be nice to have these events regardless of the outcome of that, however. |
Thanks for posting this. I've read through the linked w3c issue a couple of times, but I'm not sure what the expected behavior is. There seem to be arguments made in favor of both sides. From what I can gather so far, the firefox implementation is the preferred one. Is that correct? |
Sorry, I possibly confused the issue by linking to that spec discussion. For what it's worth, as a Web developer, I find the Firefox behavior more useful (e.g. for ignoring uncommitted input). As far as Preact is concerned, however, the issue is simply that authors can't rely on |
Hi @birtles - I think this is actually a case sensitivity issue. My guess is that you'll find this works: <input oncompositionend={() => { ... }} /> |
Oh yes, you're right. That does indeed work. |
So far as I can tell, although
jsx.d.ts
includes a definition for composition events such asonCompositionEnd
, they are not implemented.Furthermore, while
isComposing
is available throughInputEvent
, it is not normalized between browsers so, for example, in Firefox there will be an input event where it istrue
but there is not in Chrome. Without composition events it is not possible to work around this and, for example, only update search results once the current composition has been committed.Test case:
https://codesandbox.io/s/bold-currying-vqfq8
The text was updated successfully, but these errors were encountered: