I want to replace emoji with custom element, here I use span element instead my component.
The deletion is work perfectly on desktop browser.
When I using mobile to test, it will just selecting the decoration, keyboard hide and show again, then the decoration will not be deleted.
This only happen on using English Gboard keyboard, no problem on other Gboard languages.
I was only able to reproduce this on the decoration demo, not on the code you pasted. That problem was fixed by the patch I linked. Your example doesn’t actually create an editor view, so I’m not entirely sure what you may be doing. Are you sure you are including a keymap that actually binds backspace in your configuration?
I found the one of reason that backspace not work correctly, if my custom element is fill with text only, then deletion is working (but keyboard still hide and show again). If fill with emoji character or image element, deletion will be crashed.
The hiding of the keyboard is a chrome bug that CodeMirror cannot really do anything about. I cannot reproduce the thing where the widget is not deleted in your demo. But since it doesn’t provide any content for the editor, maybe you are using a different emoji or different text than I am? Could you provide a bit more detailed reproduction instructions?