Trilium-SyntaxHighlightWidget icon indicating copy to clipboard operation
Trilium-SyntaxHighlightWidget copied to clipboard

fix: highlight triggered while ime inputs are not committed

Open kaaass opened this issue 2 years ago • 0 comments

The highlighting is wrongly triggered while IME inputs are not committed, which is a normal situation for CJK inputs. The current version will give a result like this:

cn-input-issue

This PR maintains a new state inComposition in HighlightCodeBlockWidget by listening compositionstart and compositionend events, and ignores every changes fired between these events. The fix references facebook/react#3926 and ckeditor/ckeditor5#1342.

kaaass avatar Jul 18 '22 14:07 kaaass