Open hitochan777 opened 4 years ago
Thanks for reporting this and same issue for Chinese as well
I got the same issue for Chinese inputting.
And I just removed props.innerRef !== nextProps.innerRef
line in componentShouldUpdate
. So far, in my project, everything work fine. I think the reason is innerRef prop was not be changed to fire component to update.
I will go back to add comments if anything is broken.
FYI.
For me, the workaround (i.e. removing props.innerRef !== nextProps.innerRef
from componentShouldUpdate
) does not work for Chinese input.
I think this issue is related to https://github.com/facebook/react/issues/3926 . In the comments there are some workarounds that may be applicable here.
Overview
When a function is passed as innerRef, typing Japanese text (and probably other texts that require text conversion) does not work properly.
Detail
The animation below is the expected behavior. Japanese uses several kinds of characters (hiragana, katakana, and kanji; kanji is basically Chinese character). When we want to type Kanji we first type hiragana and then convert it to kanji from the list of possible candidates. The animation below is working example. As I type hiragana I see a box appears which shows the list of candidate conversions to kanji.
But when a function is passed as innerRef, the conversion box does not appear and the characters are automatically converted to the sequence of alphabets and hiragana, as you can see in the animation below.
Reproducing the problem
Reproducing code is available from here.
Possible solution
I found that removing
props.innerRef !== nextProps.innerRef
part incomponentShouldUpdate
solves this problem. But I am pretty sure this line is there because it is needed, so I doubt removing this line is the correct measure.