wix-incubator / react-native-zss-rich-text-editor

React Native rich text editor based on ZSSRichTextEditor
Other
839 stars 310 forks source link

Cannot delete image in some cases #29

Open LowCarbonGuy opened 7 years ago

LowCarbonGuy commented 7 years ago

Hi all,

I'm running into an issue where I cannot delete an image that I just inserted. I suspect I'm missing something obvious, given that no one else has mentioned this issue yet. Any pointer will be greatly appreciated, thanks!

Repro steps:

  1. Insert an image.

  2. Type some letters, e.g. Abc. After this step, the argument str in RichTextEditor.onBridgeMessage will be:

    {
    "type": "CONTENT_CHANGE",
    "data": {
    "content": "<br><img src=\"http://example.com/image.png\">Abc",
    "contentText": "Abc"
    }
    }
  3. Move the caret to the front of the line Abc.

  4. Click backspace.

Expected behavior: The image should get deleted.

Actual behavior: Both the image and the words remain. After step 4, the argument str in RichTextEditor.onBridgeMessage will be:

{
  "type": "CONTENT_CHANGE",
  "data": {
    "content": "<br><img src=\"http://example.com/image.png\"><span style=\"font-size: 1em;\">A</span><span style=\"font-size: 1em;\">b</span><span style=\"font-size: 1em;\">c</span><br>",
    "contentText": "Abc"
  }
}
zpfblockchains commented 5 years ago

hello?

Prozhou commented 5 years ago

can't delete image which before text too. @LowCarbonGuy how do you solve this problem final?cant you give me some mention. thanks

LowCarbonGuy commented 5 years ago

@Prozhou Unfortunately I've never found a solution for this problem.