Construct-bugs
Construct-bugs copied to clipboard
autocomplete will incorrectly apply expressions in CJK language IME
Problem description
Entering an expression into the CJK input method may cause AutoComplete to incorrectly to select.
Attach a .c3p
issue-autocomplete-ime.c3p.zip
Steps to reproduce
For example, there is a instance variable named 序号(xuhao) in Chinese.
- input
Sprite.display the autocomplete list.
- input
序号use IME. note: You can directly paste the序号into the input box. This operation does not affect the reproduction results.
- Note that autocomplete has not been updated at this time. If any key is pressed in this state(
Enteror+or-), it will cause the first expression in the selection list to be automatically completed.
Observed result
Autocomplete will automatically apply the first one in the expression list.
Note that this problem only occurs when the autocomplete list appears. Or in the process of input the . this expression has been selected in the autocomplete list, then it will work normally.
The following two situations can work normally:
Expected result
works as expected.
More details
Affected browsers/platforms:
First affected release:
System details
View details
PASTE HERE
I don't know if this helps, maybe this can be used to solve the problem: https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event
Observed result
你好
compositionstart:
compositionupdate: n
compositionupdate: ni
compositionupdate: ni'h
compositionupdate: ni'ha
compositionupdate: ni'hao
compositionupdate: 你好
compositionend: 你好
the 'compositionend' is the input result using IME
I have long been troubled by similar issues unrelated to Chinese or IME.
When I type "&newline&", a selection box highlighting my "Name....." item pops up, which is normal.
However, even after typing "&newline" and it turning blue, the system still automatically rewrites to me when I type in an “&”.
Please refer to the pic ↑
Hope C3 can do better and better :)
I've also been experiencing this issue, where searching with Chinese input is problematic. I really hope the official team can address this matter.
This is tricky to test because unfortunately I'm not familiar with Chinese or entering text via IME. However it looks like the Windows emoji picker (opened with Windows + .) is a type of IME entry which also fires composition events. So it seems this may be a good way to test it, using emoji in place of Chinese characters: so long as it autocompletes correctly with the emoji picker, then I think that means IME should work with other languages too.
I was able to use the emoji-picker approach to reproduce two variants of this issue: the originally noted one involving typing Sprite. followed by IME entry, and another using IME to refer to an object name (i.e. global namespace autocomplete). Hopefully this solves the problem, but I'm marking this issue as to check in the next release so others can verify how it works with IME entry for other languages like Chinese.
r405 is now out with improvements for IME. Does it work better there now?
Yes, it is work better now! I gave it a quick try and it did solve the problem, thanks you!
There is another issue: Asian symbols do not trigger autocompletion
(r190) Expressions can now use Asian characters as equivalents for latin operators: ,。“”()?:
- input 'Sprite', and cancel autocompletion
- input '.' or '。'
use . |
use 。 |
|---|---|
| Observed: show Sprite('精灵') expression | Observed: show System expression |
Another addition about Asian symbol support(off topic)
About the double quotes of Asian symbols, the quotes in Asian languages are composed of 2 different symbols“”. they exist in the same way as brackets (). Currently only 2 identical characters are allowed, either a left quote““ or a right quote””. But in Asian writing conventions this is counter-intuitive. It would be more consistent with usage habits if more support could be provided for them.
expected: “string”
Current: “string“ or ”string”
other issue: In the parameter brackets of an expression, the first character entered will be repeated
Steps to reproduce:
- abs()|
- abs(|)
- abs(qu|)
- it will automatically become
abs(qqu|)
I believe the issue described in the original report is now fixed. If there are other issues to follow up it would be best to file them separately, as issues need to be tracked separately and also include full details with each report.