ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

[Android/IME] Crash while replacing an inline image with a word

Open niegowski opened this issue 1 year ago • 1 comments

📝 Provide detailed reproduction steps (if any)

Branch ck/11438-beforeinput-ime-research-vol1.1-android.

  1. Put caret after a link
  2. Select a suggestion from the keyboard
  3. Select an inline image widget
  4. Select some suggestions from the keyboard

https://user-images.githubusercontent.com/1232187/189611972-d7e3b188-7d2a-44dd-b903-2066ce01053f.mp4

Another scenario:

  1. Start with GBoard
  2. Put caret after any word (just after it so the composition starts)
  3. Switch to SwiftKey keyboard
  4. Select an inline image widget
  5. Select some suggestions from the keyboard

✔️ Expected result

No crash

❌ Actual result

Crash

❓ Possible solution

Looks like we are still in composition mode (from the editor point of view) while replacing inline image with a word.

📃 Other details

  • Keyboards: SwiftKey
  • Language: English

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

niegowski avatar Sep 12 '22 08:09 niegowski

Apparently SwiftKeyboard gets stuck in the composition mode and forget to fire compositionend.

Ideas:

  • Turn off the isComposing flag when we create a fake selection (we are 100% sure this is not composition anymore).
  • Or when the selection change in any way.
  • Or try to do something "weird" when moving the DOM selection to the fake sel container to make all keyboards realize that something important is changing and they should cancel the composition.

Reinmar avatar Sep 12 '22 09:09 Reinmar

Closing as part of https://github.com/ckeditor/ckeditor5/issues/12058.

niegowski avatar Sep 28 '22 15:09 niegowski