Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

On android chrome deleting all content in editor causes crash #91

@PatrickTelfer

Description

@PatrickTelfer

Describe the bug
On android chrome deleting all content causes crash
Uncaught Error: Unable to find a DOM node for "2". This is often because of forgetting to add props.attributes to a custom component.

To Reproduce
Steps to reproduce the behavior:

  1. Clone and start the example at https://github.com/nossas/slate-editor/tree/develop/packages/slate-editor-example
  2. Open the app on an android device on google chrome as described in the mobile section
  3. Delete all the content in the editor
  4. Observe error

Expected behavior
Does not crash when the editor has been cleared on android chrome.

Screenshots
chrome_2020-09-30_11-13-08

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S8
  • OS: Android 8.0
  • Browser chrome
  • Version 85.0.4183.127

Additional context
Using remote debugging, I was able to determine that the span with data-key=2 is being deleted from the DOM when the editor is cleared and as a result we get the error.

chrome_2020-09-30_11-17-05
chrome_2020-09-30_11-18-41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions