Skip to content

Editor crashing when placed inside ShadowDOM, and "enter" is pressed on Android #5962

@iperzic

Description

@iperzic

Description
The editor crashes when "enter" is pressed on Android, and editor is placed inside a ShadowDOM.

Recording

Image

Sandbox
No need for a sandbox, the error can be reproduced in Shadow DOM example

Steps
To reproduce the behavior:

  1. Go to https://www.slatejs.org/examples/shadow-dom
  2. Choose an Android phone in responsive mode in browser devtools
  3. Focus the editor
  4. Press "enter"
  5. See error "Cannot resolve a Slate node"

Note: Same thing happens on a real Android phone, this is just easier to reproduce.

Expectation
User should be able to type regardless of the platform used.

Environment

  • Slate Version: 0.118.1
  • Operating System: Android
  • Browser: Chrome

Context
The problem is that some of the methods used to handle inputs on Android use native Web API, that doesn't pierce through Shadow DOM boundary, hence DOM elements aren't found.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions