-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
IText can not input chinese bug. #3069
Comments
@yanzhou-share For bug reports, could you provide a test case on Jsfiddle? |
It is a same problem |
Input problem more difficult to use Jsfiddle reflected, it is recommended to put YouTube video recording |
Need to know: |
macOS 10.11.6 (15G31) |
Same issue here. Tested with Chrome on both windows, Ubuntu..using fabric version 1.6.3 |
jsfiddle that demonstrate the problem. |
I tested with the official itext demos, input method is Sogou input method (popular input method for Chinese): |
I found it works on my Ubuntu 16.04 (Ubuntu Kylin, which is the official Chinese version of Ubuntu, with built-in Sogou IME). Tried both Chromium v51.0.2704.79 Ubuntu 16.04 (64-bit), and default Firefox in it. Last time (not work) I was testing using Chrome (not Chromium) on Ubuntu 14.04 and win7 machines.... It seems like some compatible issues with Chrome. I need more testing around to isolate who is the criminal (OS? Browser? IME?) Update more information as below: Windows7 SP1 64bit + Sogou IME: Ubuntu Kylin 16.04 + Sogou IME: Ubuntu 14.04 + Sogou IME: |
I've debugged the code and the issue is clear now, the onCompositionUpdate and onCompositionEnd event compatible issue between browsers. In firefox, the "data" will be updated on both the last "composition update" and "composition end" event, but in chrome, it will only be updated on "composition end". Below updated code (move all code from compositionupdate to compositionend) works for me on both Chrome and Firefox (on same machine with Ubuntu 14.04 and same IME): @kangax could you please help to review whether the code is ok and no impact on other code? You may merge it to your code if no issues. ` onCompositionEnd: function(e) {
}, onCompositionUpdate: function(e) { |
Update: need to have the code in both composition update and composition end, if need to simulate the typing process better. Without "composition update" code, the entered English characters will not show during typing. |
i believe this relates to #2352 |
Guys keyboard event is very different from browser to browsers. is something on wich i will work on but i do not think it will be an easy patch..other than composition event there are different ime. if i long press 'e' on mac to get list of e with accents then nothing happens... there is some work to do. |
@asturur were you able to make any progress here? |
i managed to fix the long press on mac. i submitted a bug on chromium because up to chrome 48 this thing was working enough well, while lately on chrome is completely broken. |
Do you have the hash / commit where you made the change? |
did not commot yet, looks like the fix does not work with firefox. the keyup and keydown event swallow the event and do not let the cursor run over the popup to choose. other than that number selection does not give any hint in what has been selected. text need to be reversed and make oninput event the unique source of truth of the text. i guess how many things i break if i do so. |
@asturur http://fabricjs.com/kitchensink version:1.6.2 i-text can not input chinese |
this is fixed on latest master. onInput event is better support and allow for various IME to work. |
Hi, kangax:
First of all, this plugin is very good but I find IText can not input chinese.
@kangax
thanks
The text was updated successfully, but these errors were encountered: