You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check if updating to the latest Preact version resolves the issue (it does not)
Describe the bug
When typing in a controlled text input using an IME in Preact 10.14.1, if the app does not update the text input's value during composition, Preact will forcefully update the value which will cause composition to be terminated and nothing to be input.
Activate an IME that triggers composition such as a Japanese IME
Attempt to type テスト
Expected behavior
It should be possible to compose the string テスト and commit it
Actual behavior
The input is never updated.
If we drop the following early return from onChangeText it works as expected:
if(isComposing.current){return;}
If we switch the preact dependency to 10.13.2 it also works as expected.
Note that unfortunately this is not as simple as checking the isComposing value of the input events. Composition event order and the value of isComposing is a massive interop nightmare (see w3c/uievents#202 for a start) with quite different behavior on each of the browser engines, and different behavior again on their mobile versions.
The text was updated successfully, but these errors were encountered:
Hmm, yes in Preact 10.13.2 we did not have the whole previous value restoration that made the value be more dependent on the VDOM. I was trying to see whether React had a good solution to this and it seems like they have been in this situation for a while as well facebook/react#3926 (comment). Going to try and think about a solution but worst case scenario we revert the controlled inputs system for the time being until we have a better understanding of how to deal with these. Thank you so much for the great issue description.
Describe the bug
When typing in a controlled text input using an IME in Preact 10.14.1, if the app does not update the text input's value during composition, Preact will forcefully update the value which will cause composition to be terminated and nothing to be input.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should be possible to compose the string テスト and commit it
Actual behavior
The input is never updated.
If we drop the following early return from
onChangeText
it works as expected:If we switch the preact dependency to 10.13.2 it also works as expected.
Note that unfortunately this is not as simple as checking the
isComposing
value of the input events. Composition event order and the value ofisComposing
is a massive interop nightmare (see w3c/uievents#202 for a start) with quite different behavior on each of the browser engines, and different behavior again on their mobile versions.The text was updated successfully, but these errors were encountered: