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

Randomly creates ghost lines when using IME input. #1821

Closed
linjie0928 opened this issue Mar 21, 2024 · 16 comments
Closed

Randomly creates ghost lines when using IME input. #1821

linjie0928 opened this issue Mar 21, 2024 · 16 comments

Comments

@linjie0928
Copy link

When I input Chinese IME, the program randomly creates line breaks, and the generated blank lines cannot be deleted.
This only happens when used inside Angular, and it will not happen when imported directly into HTML.

in action video:
https://github.com/KillerCodeMonkey/ngx-quill/assets/44791594/d51f16ae-4ec4-4f0e-9d2b-d85125975182

@linjie0928
Copy link
Author

linjie0928 commented Mar 21, 2024

I found the exact sequence to trigger it.

  1. Entering a letter into an IME
  2. Delete key
  3. Enter key
    ghost line will apear.
2024-03-21.5.52.07.mov

@KillerCodeMonkey
Copy link
Owner

can you please check this if this appears in native quilljs editor as well?

because i am not doing special. it should be a quilljs issue.
Please check quill v1 and v2 release candidate.

@linjie0928
Copy link
Author

This problem does not occur in native quilljs, but it does happen if I directly import quill.js into Angular without using ngx-quill.

@KillerCodeMonkey
Copy link
Owner

KillerCodeMonkey commented Mar 21, 2024

but then there is nothing i can do. because i have no special handling in there that could produce this.

Which quill version do you use?

@linjie0928
Copy link
Author

linjie0928 commented Mar 21, 2024

In your example, you can reproduce the same situation:
https://killercodemonkey.github.io/ngx-quill-example/
I recorded the screen in your example.

My quill version is ^2.0.0-rc.3

@KillerCodeMonkey
Copy link
Owner

strange. but i have no glue why this should happen.
i just go with the quilljs api to insert content and do not touch the real content/user input. just connecting it with angular inputs/outputs.

so if you have an idea. let me know

@luin
Copy link

luin commented Mar 22, 2024

I didn't reproduce it actually: https://share.slab.com/1y3BXNSs

Also not sure why in your screencast, the placeholder presented when the caret is at the second line: https://share.slab.com/8hP0ZlY2.

@linjie0928
Copy link
Author

linjie0928 commented Mar 22, 2024

The strange caret position is the ghost line i talking about. XD
I can only delete it by selecting and typing other text over it.
It will only happen to the first letter of a line, but it will not happen in the text.

Maybe it’s because Taiwan’s phonetic 注音輸入法 IME is rather special....
I will encounter the same situation on safari.
Or it's a OS problem. My OS is Sonoma 14.3

截圖 2024-03-22 上午11 36 56

action detail video
https://github.com/KillerCodeMonkey/ngx-quill/assets/44791594/32bfd67e-a0e5-4d11-b639-fe5fa48c7608

@linjie0928
Copy link
Author

I have been looking for the problem for a long time. The difference I have found so far is that if I run Quill directly in index.html, there is no problem. But once I move it to the component and leave the IME, the ghost line will appear.

截圖 2024-03-25 中午12 15 35

@KillerCodeMonkey
Copy link
Owner

since then it is a general problem angular + quill + ime and is not related to this package here.

It would be nice that this issue moves then somewhere it really belongs to :D

@linjie0928
Copy link
Author

I'm wondering how best to address this issue that's been significantly hindering the development of my project. I've attempted to raise it on the quill.js side, but it's been closed by @luin without much follow-up. Would it be appropriate to escalate this matter to the Angular team?"

@linjie0928 linjie0928 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
@linjie0928
Copy link
Author

linjie0928 commented Mar 26, 2024

I temporarily fixed the issue; we need to unpatch compositionend event from zone.js.

@KillerCodeMonkey

截圖 2024-03-26 上午11 42 46

@KillerCodeMonkey
Copy link
Owner

But Do you know What other Effects That will have.

Because changing default angular/zone.js behavior is maybe not the Best idea.

Maybe it is working now with your issue but Produces some more for others

@KillerCodeMonkey
Copy link
Owner

So i will add section for known issues and add there some hints about deactivating zonejs event on own risk.

@KillerCodeMonkey
Copy link
Owner

@KillerCodeMonkey
Copy link
Owner

I will close this because i will not globally unpatch events to avoid unexpected sideeffects in other apps

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

3 participants