codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.44k stars 343 forks source link

codemirror/view 6.28.2 version will cause abnormal input of Chinese input method #1396

Open oeyoews opened 1 week ago

oeyoews commented 1 week ago

Describe the issue

image

https://github.com/codemirror/dev/assets/72405338/a5880b21-e9e2-4ae7-92db-a3f221e4ecd8

The last version of the commit codemirror/view will cause abnormal input of Chinese input method(IME), and some console errors will appear (the error message is not 100% reproducible for the time being)

Browser and platform

google chrome: 126.0.6478.116 Windows 11

Reproduction link

marijnh commented 1 week ago

Browser and platform No response

See that's not really helpful. Please let us know which browser, platform, and precise IME you're seeing this with.

Hydrowood0 commented 1 week ago

Browser and platform No response

See that's not really helpful. Please let us know which browser, platform, and precise IME you're seeing this with.

https://4bug-report.tiddlyhost.com/ You can reproduce this bug HERE online

oeyoews commented 4 days ago

Browser and platform No response

See that's not really helpful. Please let us know which browser, platform, and precise IME you're seeing this with.

Related information has been supplemented

Arcticn commented 4 days ago

Browser and platform No response

See that's not really helpful. Please let us know which browser, platform, and precise IME you're seeing this with.

This issue can be reproduced on https://codemirror.net/ But this is a Chromium-only problem, Firefox works perfect.

oeyoews commented 4 days ago

Browser and platform 浏览器和平台 No response 没有回应

See that's not really helpful. Please let us know which browser, platform, and precise IME you're seeing this with.看到这真的没有帮助。请让我们知道您看到的是哪个浏览器、平台和精确的 IME。

This issue can be reproduced on https://codemirror.net/本期可在 https://codemirror.net/ 上转载 But this is a Chromium-only problem, Firefox works perfect.但这是一个仅限 Chromium 的问题,Firefox 运行良好。

image Indeed it is

marijnh commented 4 days ago

What IME language are you using? (Precisely — I know you mention Chinese, but Windows supports a bunch of different Chinese IMEs.)

What key strokes demonstrate the issue? What is the expected outcome, and what happens in CodeMirror? Please describe this so that someone who doesn't know Chinese can verify the issue.

Arcticn commented 4 days ago

What IME language are you using? (Precisely — I know you mention Chinese, but Windows supports a bunch of different Chinese IMEs.)

What key strokes demonstrate the issue? What is the expected outcome, and what happens in CodeMirror? Please describe this so that someone who doesn't know Chinese can verify the issue.

For me, IME language is Chinese (Simplified, China).When comes to keyboards, both Microsoft Pinyin and Microsoft Wubi can trigger this problem

You can try to input zhongwen with Microsoft Pinyin on https://codemirror.net/ in a Chromium browser(My edge and chrome are both 126+), Firefox just works well. Seems every character can reproduce this problem that the IME would not find the correct position.

marijnh commented 2 days ago

For me, using Chrome 126 with simplified Chinese IME, typing zhongwen + space in the editor on codemirror.net gives 中文, which looks reasonable. Is there anything else I should be doing to reproduce the issue?

Arcticn commented 2 days ago

Yes, gives 中文 is correct. However, the problem is when you're typing, the IME keeps jump up and down.My chrome version is 126.0.6478.127, and edge is 126.0.2592.81 Foucs on the IME itself in the video, can you reproduce it?

https://github.com/codemirror/dev/assets/46252987/0b479fff-3e60-492f-ae00-0353bd1cb200

marijnh commented 2 days ago

Oh right, I see what you mean now. That was an obvious bug. Attached patch (released as 6.28.3) should fix it. Not sure how that that wasn't visible on Chrome Linux.

imzbf commented 2 days ago

It seems that this issue still persists, and I am currently using version @codemirror/view@6.28.3.

录屏2024-07-01 17 16 52

Browser and platform

Chrome: 126.0.6478.127 MacOS:14.5 simplified Chinese IME

You can attempt to replicate it in the following online example. https://codesandbox.io/p/devbox/elated-cherry-ph6y5c?file=%2Findex.html%3A21%2C36

And event compositionstart was not triggered correctly too. Is there a problem with my code?

marijnh commented 2 days ago

Are you seeing the incorrectly positioned IME widget problem, or are you seeing another problem?

compositionstart (as well as other composition events) is no longer fired when the editor uses EditContext. You may be able to query CodeMirror's own composing property for a more reliable way to detect composition.

imzbf commented 2 days ago

录屏2024-07-01 17 16 52

Yes, this is a non looping GIF image, it records problem.

marijnh commented 2 days ago

Yes, that looks like the old bug. Is it gone on https://codemirror.net for you?

imzbf commented 2 days ago

Yes, that looks like the old bug. Is it gone on https://codemirror.net for you?

It still appears sometimes

image image
Arcticn commented 2 days ago

It can be 100% reproduced if I try to input enormous characters in the inputbox (In this video, 28000 characters) Again, just try to input zhongwen+space at the end of the input (characters before perform well) in a chromium brower on Windows. Firefox still works well.

https://github.com/codemirror/dev/assets/46252987/698405c5-3087-4080-bb50-78b2dbc3a9ce

mingchiuli commented 1 day ago

It happen on Chrome. Firefox is normal.

marijnh commented 46 minutes ago

I think I managed to reproduce the issue visible in your screencast. Try again with 6.28.4.

The IME interface appearing the wrong place happens for me when I start the composition at the start of a line. I verified that CodeMirror is giving the correct coordinates to the browser when this happens, so I suspect that is a Chrome bug. I'll spend some more time trying to reproduce and report that later.