Skip to content
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

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

Open
oeyoews opened this issue Jun 23, 2024 · 24 comments

Comments

@oeyoews
Copy link

oeyoews commented Jun 23, 2024

Describe the issue

image

Screenity.video.-.Jun.23.2024.mp4

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
Copy link
Member

marijnh commented Jun 23, 2024

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
Copy link

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
Copy link
Author

oeyoews commented Jun 29, 2024

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
Copy link

Arcticn commented Jun 29, 2024

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
Copy link
Author

oeyoews commented Jun 29, 2024

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
Copy link
Member

marijnh commented Jun 29, 2024

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
Copy link

Arcticn commented Jun 29, 2024

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
Copy link
Member

marijnh commented Jul 1, 2024

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
Copy link

Arcticn commented Jul 1, 2024

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?

Recording.2024-07-01.142726.mp4

@marijnh
Copy link
Member

marijnh commented Jul 1, 2024

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
Copy link

imzbf commented Jul 1, 2024

It seems that this issue still persists, and I am currently using version @codemirror/[email protected].

录屏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
Copy link
Member

marijnh commented Jul 1, 2024

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
Copy link

imzbf commented Jul 1, 2024

录屏2024-07-01 17 16 52

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

@marijnh
Copy link
Member

marijnh commented Jul 1, 2024

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

@imzbf
Copy link

imzbf commented Jul 1, 2024

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

It still appears sometimes

image image

@Arcticn
Copy link

Arcticn commented Jul 1, 2024

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.

Recording.2024-07-01.212905.mp4

@mingchiuli
Copy link

It happen on Chrome. Firefox is normal.

marijnh added a commit to codemirror/view that referenced this issue Jul 3, 2024
FIX: Fix a bug where EditContext-based editing could corrupt the document
in some situations.

Issue codemirror/dev#1396
@marijnh marijnh reopened this Jul 3, 2024
@marijnh
Copy link
Member

marijnh commented Jul 3, 2024

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.

@Arcticn
Copy link

Arcticn commented Jul 4, 2024

Sure, the problem with long article is fixed and the other problem remains, thanks for your work!

@marijnh
Copy link
Member

marijnh commented Jul 4, 2024

I've reported this in the Chrome tracker as #351029417. Sometimes clicking the +1 button at the top of an issue there helps get attention to it.

@amoydavid
Copy link

amoydavid commented Jul 5, 2024

I encountered the same issue on Mac. The phenomenon I observed is that in Chrome with CodeMirror 6, the Chinese input method hint box moves to the upper left with input. The same browser behaves normally with CodeMirror 5. CodeMirror 6 with Safari is also normal.

@Rainer-Yu
Copy link

126.0.6478.183 (arm64)
macOS Sequoia Beta 15.0 (24A5298h)
System built-in Simplified Pinyin IME
image

image

@orzass
Copy link

orzass commented Aug 3, 2024

WX20240803-151144@2x

Microsoft Edge
127.0.2651.74 (arm64)
macos sonoma 14.5
sougou pinyin IME

it still happen.

@marijnh
Copy link
Member

marijnh commented Aug 3, 2024

I'm aware it is still happening. See the Chrome issue I linked above. That has not been fixed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants