From aff3329e4028f23ba0eddf86c603fc84aa3c04bd Mon Sep 17 00:00:00 2001 From: Kerry Johnson Date: Tue, 17 Sep 2024 08:17:12 -0500 Subject: [PATCH] Let element exist in DOM before grabbing attribute Otherwise original code will initiate fallback process prematurely by attempting to grab the same icon in other logo types (which doesn't really make sense for logos anyway, but this should at least stop the prevailing issue). --- src/box-icon-element.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/box-icon-element.js b/src/box-icon-element.js index 6a38d2a..7017f83 100644 --- a/src/box-icon-element.js +++ b/src/box-icon-element.js @@ -162,7 +162,6 @@ export class BoxIconElement extends HTMLElement { } this._state = { $iconHolder: this.$ui.getElementById('icon'), - type: this.getAttribute('type') }; } @@ -211,6 +210,9 @@ export class BoxIconElement extends HTMLElement { } connectedCallback() { + this._state = { + type: this.getAttribute('type') + }; if (usingShadyCss()) { GLOBAL.ShadyCSS.styleElement(this); }