quill icon indicating copy to clipboard operation
quill copied to clipboard

In an Angular environment, an unremovable empty line appears when leaving IME mode.

Open linjie0928 opened this issue 1 year ago • 4 comments

In an Angular, when inputting Chinese, an unremovable empty line appears when leaving IME mode at the beginning of each line.

I'm sorry for reposting the issue. After several days of research, I found that it is not related to ngx-quill. Even when directly referencing QuillJS within Angular, the same behavior occurs. I've also tested it on a brand new Mac computer with the Sonoma operating system, and the issue persists.

Steps for Reproduction

  1. Visit https://stackblitz.com/edit/angular-17-starter-project-e9hbuq?file=src%2Fmain.ts
  2. Move to start of line.
  3. Enter IME mode
  4. backspace to leave IME
  5. Unremovable line appears

Actual behavior: https://github.com/quilljs/quill/assets/44791594/aaccfa7f-6618-45bc-a331-c096a59b5890

Platforms: angular 17, Sonoma 14.3, Chrome 123.0.6312.58 and Safari 17.3 has same behavior

Version: v2.0.0-rc.4

linjie0928 avatar Mar 25 '24 12:03 linjie0928

Thanks for the details! Can you reproduce it when running without Angular?

luin avatar Mar 25 '24 15:03 luin

I was able to reproduce the issue successfully without Angular, which I hope is helpful.

https://stackblitz.com/edit/stackblitz-starters-pntnad?file=index.html

I found the problem, but I don't know the reason. After commenting out this section in polyfills.js, everything works fine.

截圖 2024-03-26 凌晨1 17 16

linjie0928 avatar Mar 25 '24 16:03 linjie0928

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

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

linjie0928 avatar Mar 26 '24 03:03 linjie0928

Something could be related: https://github.com/quilljs/quill/pull/3972. The PR fixed a similar issue for Safari where the cause was the timing of compositionend is different in Safari.

luin avatar Mar 26 '24 06:03 luin