Skip to content

TypeError when trying to open 2 NewWindows in same windowΒ #159

@Aleafan

Description

@Aleafan

Hi! Thanks a lot for your work!

I found that when trying to open 2 different NewWindow components in the window with the same name, TypeError in thrown:
image

The problem is in the code below - staticContainer is not found so equals to null and removeChild method expects argument of type Node only.

// Remove any existing content
const staticContainer = this.window.document.getElementById(
  'new-window-container-static'
)
this.window.document.body.removeChild(staticContainer)

When I add staticContainer check it works just fine:
staticContainer && this.window.document.body.removeChild(staticContainer)

Is it even supposed to work in that way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions