Skip to content

Bug: Binding to webcomponent shadow root fails #2119

@yuzuquats

Description

@yuzuquats

I'm working on converting lexical into an es6 module + webcomponent. I've been able to successfully bundle an es6 module (using webpack). Using it as a top-level component in the HTML document root works, but including it as a webcomponent doesn't.

Lexical version: 0.25

Steps To Reproduce

  1. import a bundled lexical.bundle.min.js file
  2. bind Lexical to an editor in the root DOM (ie. document.getElementById("editor")), and observe that it works
  3. bind Lexical to an editor in the shadow DOM (this.shadowRoot.querySelector("#editor"), and observe that it doesn't work.
  • The shadow dom's editor does receive attributes for data-lexical-editor=true among others
  • The shadow dom does not receive key inputs

Link to code example:

Screen.Recording.2022-05-09.at.12.53.07.PM.mov

https://github.com/yuzuquats/lexical-web-component

Any help would be appreciated! I'm fairly new to npm so if there's anything obvious I'm missing I'd love to learn!

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