ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

IME: errors when typing in Burmese language on Windows

Open FilipTokarski opened this issue 2 years ago β€’ 13 comments

πŸ“ Provide detailed reproduction steps (if any)

  1. Use Windows machine
  2. Open editor demo
  3. Change language to Myanmar (Visual Order)
  4. Type the following sequence: tm;vHk;yJ tqifayjujygap>

βœ”οΈ Expected result

You are able to type the full sequence. Text composes properly- α€‘α€¬α€Έα€œα€―α€Άα€Έα€•α€² α€‘α€†α€„α€Ίβ€Œα€•α€Όα€±α€€α€Όα€•α€«α€…α€±α‹

❌ Actual result

Not able to finish typing, composition stops just before few last characters. If you then put cursor after this text and start typing, errors are thrown:

Uncaught CKEditorError: model-nodelist-offset-out-of-bounds {"offset":23,"nodeList":[{"data":"α€‘α€¬α€Έα€œα€―α€Άα€Έα€•α€² ထဆင်ပြေကြပါ"}]}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-model-nodelist-offset-out-of-bounds
   at va.offsetToIndex (ck-demo-external-feature-rich-e4b9a235dc.js:2:654301)
   at _a.offsetToIndex (ck-demo-external-feature-rich-e4b9a235dc.js:2:657026)
   at Da (ck-demo-external-feature-rich-e4b9a235dc.js:2:667738)
   at get textNode [as textNode] (ck-demo-external-feature-rich-e4b9a235dc.js:2:662150)
   at Ac (ck-demo-external-feature-rich-e4b9a235dc.js:2:799762)
   at vc._validateSelectionRange (ck-demo-external-feature-rich-e4b9a235dc.js:2:799598)
   at qa._validateSelectionRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:697698)
   at qa._replaceAllRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:697477)
   at qa._setRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:688630)
   at qa.setTo (ck-demo-external-feature-rich-e4b9a235dc.js:2:687738)
   
   
Uncaught CKEditorError: insert-operation-position-invalid
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-insert-operation-position-invalid
   at ql._validate (ck-demo-external-feature-rich-e4b9a235dc.js:2:748272)
   at Oc.on.priority (ck-demo-external-feature-rich-e4b9a235dc.js:2:824101)
   at Oc.fire (ck-demo-external-feature-rich-e4b9a235dc.js:2:476345)
   at <computed> [as applyOperation] (ck-demo-external-feature-rich-e4b9a235dc.js:2:480064)
   at Ec.insert (ck-demo-external-feature-rich-e4b9a235dc.js:2:805599)
   at Pc._insertPartialFragment (ck-demo-external-feature-rich-e4b9a235dc.js:2:818131)
   at Pc.handleNodes (ck-demo-external-feature-rich-e4b9a235dc.js:2:816742)
   at ck-demo-external-feature-rich-e4b9a235dc.js:2:826202
   at Oc.change (ck-demo-external-feature-rich-e4b9a235dc.js:2:828385)
   at Oc.<anonymous> (ck-demo-external-feature-rich-e4b9a235dc.js:2:825529)
   
   
Uncaught CKEditorError: model-nodelist-offset-out-of-bounds {"offset":24,"nodeList":[{"data":"α€‘α€¬α€Έα€œα€―α€Άα€Έα€•α€² ထဆင်ပြေကြပါ"}]}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-model-nodelist-offset-out-of-bounds
   at va.offsetToIndex (ck-demo-external-feature-rich-e4b9a235dc.js:2:654301)
   at _a.offsetToIndex (ck-demo-external-feature-rich-e4b9a235dc.js:2:657026)
   at Da (ck-demo-external-feature-rich-e4b9a235dc.js:2:667738)
   at get textNode [as textNode] (ck-demo-external-feature-rich-e4b9a235dc.js:2:662150)
   at Ac (ck-demo-external-feature-rich-e4b9a235dc.js:2:799762)
   at vc._validateSelectionRange (ck-demo-external-feature-rich-e4b9a235dc.js:2:799598)
   at qa._validateSelectionRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:697698)
   at qa._replaceAllRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:697477)
   at qa._setRanges (ck-demo-external-feature-rich-e4b9a235dc.js:2:688630)
   at qa.setTo (ck-demo-external-feature-rich-e4b9a235dc.js:2:687738)

❓ Possible solution

If you have ideas, you can list them here. Otherwise, you can delete this section.

πŸ“ƒ Other details

  • Browser: …
  • OS: …
  • First affected CKEditor version: …
  • Installed CKEditor plugins: …

If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

FilipTokarski avatar Jun 06 '23 14:06 FilipTokarski

@FilipTokarski could you check how it behaves on MacOS?

Witoso avatar Jun 12 '23 08:06 Witoso

macOs Chrome: Screenshot 2023-06-12 at 12 20 29

macOs Firefox: Screenshot 2023-06-12 at 12 20 18

Composition finishes properly. However, the first part has a bit different characters.

FilipTokarski avatar Jun 12 '23 10:06 FilipTokarski

Wanted to add two additional key sequences that we've heard cause issues with CKEditor + Windows to provide more reproduction steps.

  • Typing awmh should produce တော့
  • Typing taumifh should produce ထကောင့်

slotterbackW avatar Jan 08 '24 17:01 slotterbackW

@FilipTokarski could you check the behavior of those short sequences on Windows again?

Witoso avatar Jan 09 '24 08:01 Witoso

Chceked on latest (41.0.0) docs and I'm not able to reproduce the error.

FilipTokarski avatar Jan 18 '24 15:01 FilipTokarski

@FilipTokarski does it result in the exact values?

  • Typing awmh should produce တော့
  • Typing taumifh should produce ထကောင့်

Witoso avatar Jan 18 '24 15:01 Witoso

Yes, those were working ok for me as well.

FilipTokarski avatar Jan 19 '24 07:01 FilipTokarski

Based on the above @slotterbackW any chance you could organize tests with your power users on the testing of native Windows IME? It's much easier to debug this one for us than the KeyMagic one.

Witoso avatar Jan 23 '24 08:01 Witoso

Yep I asked them yesterday! They came back and said

Firstly we attempted to enter စေ။ by typing ap>. It worked perfectly. We then tried to enter ပါစေ။ by typing ygap>, and we managed to reproduce the issue. We could see that after typing ygap, the blinking cursor disappeared as CKEditor had lost focus. At this point of time, typing > resulted nothing to the editor. When I pressed the space bar, the scrollbar immediately jumped to the end of the page. I had to click into the editor again to resume typing. I could see that the underline did not go away after typing >

Just restating, sounds like typing ygap using the Myanmar (Visual Order) keyboard on Windows caused the editor to lose focus once the p was typed. This was after typing another set of characters so not sure if that's a factor or not.

slotterbackW avatar Jan 24 '24 17:01 slotterbackW

typing ygap using the Myanmar (Visual Order) keyboard on Windows caused the editor to lose focus once the p was typed

Yes, I can reproduce this behaviour. It manifests in two ways:

  • If you type ygap in the empty editor or what you type is the last line in the editor - the editor wil lose focus
  • If you type ygap between content/paragraphs - selection will jump to the next line

FilipTokarski avatar Jan 26 '24 14:01 FilipTokarski

Oh, actually if you type ygap in the empty editor and then when you focus the editor again (just click in the editing area), you get the error that was reported in the initial message:

Uncaught CKEditorError: model-nodelist-offset-out-of-bounds

So unfortunately it's still there.

FilipTokarski avatar Jan 26 '24 14:01 FilipTokarski

We were researching this issue. The problem is that for this language, the browser is not firing the compositionend event after typing ygap, instead it moves the selection forward, in most cases by 2 characters. If the typed phrase is at the end of the editor, then the selection jumps to the nearest text node after the editor. While typing inside some text, the selection jumps 2 characters forward. The same behavior can be reproduced in the plain content-editable element so this is a browser bug.

Since the compositionend event was not fired, the model is not updated and there is a misalignment between the DOM and model/view, and position mapping fails (the reported model-nodelist-offset-out-of-bounds error).

While debugging it we were looking for a workaround. This is a tricky case because without the compositionend event, we do not have the data to insert into the model (we do not use beforeinput insertCompositionText on desktop). We could try to monitor the document selection and try to "break" the composition if detected selection outside the composed range, but this is tricky since the composition does not provide API to stop it.

Since the above happens only in Chrome on Windows I'd like to check if implementing the EditContext could help resolving this issue.

niegowski avatar May 25 '24 09:05 niegowski

@niegowski can we report this issue to the Chromium with the reproduction steps?

Witoso avatar May 27 '24 09:05 Witoso

@niegowski can we report this issue to the Chromium with the reproduction steps?

Reported to Chromium: https://issues.chromium.org/issues/344767735

niegowski avatar Jun 04 '24 16:06 niegowski

@slotterbackW we will push it through Chromium support, it's possible that this also affects this KeyMagic bug (#14117), but I'm not sure. It's weird that both are related to Chrome + Windows.

Witoso avatar Jun 05 '24 17:06 Witoso