Can't delete image in contenteditable div on Android

后端 未结 3 1274
情书的邮戳
情书的邮戳 2021-02-08 08:12

I am building a rich text editor in android. To do so, I am using a webView with a contentEditable div.

To add styles, I invoke JavaScrip

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-08 08:39

    Android: Backspace in WebView/BaseInputConnection

    Subclass Webview and override the method as shown by this guy's question.

    On some phones, only the guy's question will satisfy the requirements. The link's answer will complete the code for compatibility with other phones. Though, you subclass a InputConnectionWrapper. not inputconnection. and then return that wrapper within your custom webview.

    Just a FYI, this link has a much more detailed explanation of the situation, however I tried quickly implementing their ideas and it didn't work. Maybe too complicated for my purposes. The reason I tried their solution instead of what I mentioned above is because the solution I mentioned above causes the voice-to-text function to not work correctly. Android - cannot capture backspace/delete press in soft. keyboard

提交回复
热议问题