slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
42.3k stars 3.31k forks source link

Changing format using quill.formatText while editing causes omitting/adding some characters #4249

Open postBG opened 3 weeks ago

postBG commented 3 weeks ago

I'm implementing an editor that shows suggestions on the user's text (by highlighting suggestion-related parts) while a user is editing the text. The editor's target language is Korean. And, highlighting is implemented using 'quill.formatText'. However, formatting while editing removes or duplicates the user's input.

https://github.com/slab/quill/assets/5331855/f0ff720b-2667-40f7-9357-5825a7b8881a

Changing the format using 'quill.formatText' while typing some Korean texts (bold or italic also causes the problem) easily reproduces the problem.

In the video, I try to input 문제가 생긴거야? 진짜 while formatting 생긴거야? using a custom format. However, bold or italic also causes the problem. Then, is duplicated. I guess I was adding while the formatting API was called.

Expected behavior: In the video, the expected result is that the editor shows '문제가 생긴거야? 진짜' while the highlight is properly rendered.

Actual behavior: The text is duplicated.

Platforms: I tested it on Chrome Ver 125.0.6422.60. However, It happens on the previous versions as well. Operating system is Mac OS 14.4(23E214). However, again, It happens on the previous mac OS versions as well.