Skip to content

Commit 4006913

Browse files
author
Daniel Morse
committed
fix: check if component was initially rendered before removing children, IE runs twice on background component and empties the rendered HTML
1 parent ba7dfd6 commit 4006913

File tree

1 file changed

+6
-3
lines changed
  • packages/components/bolt-image/src

1 file changed

+6
-3
lines changed

packages/components/bolt-image/src/image.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ class BoltImage extends withLitHtml() {
6666
}
6767

6868
connecting() {
69-
super.connecting && super.connecting();
70-
while (this.firstChild) {
71-
this.removeChild(this.firstChild);
69+
// IE fires this twice, only let it remove children once
70+
if (!this._wasInitiallyRendered) {
71+
super.connecting && super.connecting();
72+
while (this.firstChild) {
73+
this.removeChild(this.firstChild);
74+
}
7275
}
7376
}
7477

0 commit comments

Comments
 (0)