fix(overlays): guard for backdrop parent node on teardown
This commit is contained in:
parent
9f0691609f
commit
9352b577fa
2 changed files with 7 additions and 2 deletions
5
.changeset/nice-flowers-arrive.md
Normal file
5
.changeset/nice-flowers-arrive.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@lion/overlays': patch
|
||||
---
|
||||
|
||||
Guard backdrop node parentNode when removing the backdrop node on teardown.
|
||||
|
|
@ -1016,8 +1016,8 @@ export class OverlayController extends EventTargetShim {
|
|||
this.__backdropNodeToBeTornDown = this.backdropNode;
|
||||
|
||||
this.__backdropAnimation.then(() => {
|
||||
if (this.__backdropNodeToBeTornDown) {
|
||||
/** @type {HTMLElement} */ (this.__backdropNodeToBeTornDown.parentNode).removeChild(
|
||||
if (this.__backdropNodeToBeTornDown && this.__backdropNodeToBeTornDown.parentNode) {
|
||||
this.__backdropNodeToBeTornDown.parentNode.removeChild(
|
||||
this.__backdropNodeToBeTornDown,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue