Skip to content

Check if element is attached to DOM is too specific #2642

@nlundquist

Description

@nlundquist

The check made here:

if (!document.body.contains(parent)) {

before throwing a warning is too narrow. It fails when xterm is opened inside a parent element inside a WebComponent shadow root. document.body.contains(parent) will return false, even thought the parent is fully attached and visible on the page.

Details

  • Browser and browser version: Firefox 71, Chrome 79
  • OS version: OS X
  • xterm.js version: 4.3.0

Steps to reproduce

  1. Create a simple WebComponent rendering a single div
  2. Use Terminal.open to create a new terminal inside that div
  3. The warning will be produced even though the elements are fully attached and rendered

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions