-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Korean IME input issue on Chrome after the latest update #1484
Comments
Could you tell me which physical keys you press to type that (since I have no idea)? Does this happen for all characters or just specific ones? |
You can type any characters in Korean. It occurs in all characters. Thank
you.
2024년 8월 28일 (수) 오후 5:38, Marijn Haverbeke ***@***.***>님이 작성:
… Type any Korean word, such as "한글".
Could you tell me which physical keys you press to type that (since I have
no idea)? Does this happen for all characters or just specific ones?
—
Reply to this email directly, view it on GitHub
<#1484 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOIKFBHT4S62WHQWWUKCBRDZTWEBPAVCNFSM6AAAAABNHIT26OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUGY4TCNJZGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Looks like the browser was, in this situation, firing a keydown even before notifying the script that the selection changed (which is generally done before any input events fire). Attached patch makes the library actively query the DOM selection before handling key events. |
Thank you, Marjin. I checked, and the solution works. You are a great
developer. I appreciate all your work.
2024년 8월 30일 (금) 오후 10:14, Marijn Haverbeke ***@***.***>님이 작성:
… Looks like the browser was, in this situation, firing a keydown even
before notifying the script that the selection changed (which is generally
done before any input events fire). Attached patch makes the library
actively query the DOM selection before handling key events.
—
Reply to this email directly, view it on GitHub
<#1484 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOIKFBG7SWDRGNIHD3ADEF3ZUBV2XAVCNFSM6AAAAABNHIT26OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRRGIYTSMJYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I noticed this change breaks some, frankly, pretty funky stuff we're doing in TipTap to workaround the inability to cancel most events on Android. It only breaks one test in our hundreds and it's not a Prosemirror bug, but this is plaguing us nonetheless. I wonder if there's any way we can prevent this behavior in a select circumstance? I tried forcibly setting |
After studying
I know none of this is highly advisable. We can always use a custom fork or |
Without info on what that test is trying to do, I can't say much here. But yeah, reaching into random internals to try and influence code paths seems ill-advised. |
Thanks for your reply @marijnh. Basically we're invoking the editor to set a selection inside of a The entirety of the logic is pretty complex and I haven't had time to see if we can fix this by instead setting a flag in I wish Android's webview and/or IME would let you override them instead of forcing you to fight them so such crazy things wouldn't be necessary to begin with... |
Unfortunately Is there any way we could circumvent this logic on a case-by-case basis, or any other way this could be implemented that might not conflict with existing logic? Edit: I did a "quick" (painstaking) test and I think this can be worked around, but I'm not certain yet. |
Working around this The Right Way™ is possible but it causes confusing selection logic on Android, both out of the box and after undo due to us having to manually correct the selection. I don't really know how to fully outline the problem since the relevant code is literally hundreds of lines, and there doesn't really seem to be any way to resolve this fully from our end. It's not a showstopper, but it is a downgrade in the quality of our editor at the end of the day. I think the root cause here is that we were relying on setting a custom selection, let's say, I think the root problem might be that after deleting the expanded selection that includes I know this is a terrible bug report - I just don't know how to better describe or demonstrate the issue. Any thoughts? Sorry I can't come up with a better way to communicate this. |
I wonder if this PR is necessary on Android? All our woes would disappear if this behavior could be gated to only affect desktop environments - though I'm not sure that's viable. |
Do I understand correctly that the issue you're running into occurs when someone starts typing with your custom selection active, because the browser mangles the selection right before the typing starts, causing ProseMirror to read an unintended small selection, and thus not overwriting the content it should overwrite? Is it possible to try and condense this down to a small example script whose behavior I could observe on my side? |
Upon further reflection, I can't honestly say I know exactly where this behavior is coming from. Previously my findings were based on ever so slightly different implementations, but now that I have a fully working implementation in I'm not certain how to reproduce this at the moment. It's theoretically possible I could make a repro, but we're already shipping mega-late, the logic isn't straightforward, it's a relatively minor issue, and without knowing what part(s) are required to reproduce the issue I can't imagine when I'd be able to find the time to properly repro this in the near future. I'm not sure of the value, but I did at least capture screen recordings of the discrepancy in the hopes that something might jump out to you. To briefly explain the setup here, the red selected widget represents text that's programmatically selected, but is not displayed. Not sure why the videos are so dark. Sorry about that! Additional findings: Chrome on PC is unaffected. Safari is unaffected. Only Chrome for Android (and Android webview) seem to be affected.
|
This particular issue appears to possibly occur in TipTap 2.7.0 which theoretically should use
|
https://issues.chromium.org/issues/363266897 In Chromium version 128, there was a bug related to selection due to IME changes, but this has been fixed and deployed in versions 128.xx, 129.xx, and 130.xx If you need the specific code for this fix, rolling back should be feasible if necessary. |
@dineug great find! @wisdomcrane I wonder if you test an older version of |
@Nantris Thank you for letting me know this. I think the issue was resolved in the chrome 129.0.6668.45 build. |
All right, I've reverted ProseMirror/prosemirror-view@42d6b1d in ProseMirror/prosemirror-view@a8d862d, on the assumption that the group of people still impacted by this issue is tiny. |
What is the issue?
After the latest Chrome update, there is an issue with typing Korean characters using IME in the ProseMirror editor. When typing Korean and pressing Enter, the last character disappears or is not displayed correctly.
Steps to reproduce
Expected behavior
The typed Korean word should remain intact in the editor after pressing Enter.
Actual behavior
The last Korean character is removed or does not display correctly after pressing Enter.
Environment
"prosemirror-codemirror-block": "^0.5.7",
"prosemirror-commands": "^1.6.0",
"prosemirror-example-setup": "^1.2.3",
"prosemirror-keymap": "^1.2.2",
"prosemirror-markdown": "^1.13.0",
"prosemirror-model": "^1.22.3",
"prosemirror-schema-basic": "^1.2.3",
"prosemirror-schema-list": "^1.4.1",
"prosemirror-tables": "^1.5.0",
"prosemirror-view": "^1.34.1",
Additional context
Enter
Workaround
By returning true in the compositionend event handler, I was able to stop the unexpected update.
But I think this is workaround now. It is not recommend, becuase it can break the system.
Please let me know if you need more information or if I can assist further in reproducing this issue.
The text was updated successfully, but these errors were encountered: