Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure child node is a child of parent before removing
Fixes glimmerjsGH-1401 If `current` isn't a child of `parent` calling `parent.removeChild(current)` will result in the error: `Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node`. This commonly occurs when the DOM is externally modified by a browser, such as when translating a page. The `nextSibling` may not be a child node of `parent`. `current.parentNode?.removeChild(current)` ensures we are only removing a child node of a parent node.
- Loading branch information