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).
This commit is contained in:
Kerry Johnson 2024-09-17 08:17:12 -05:00 committed by GitHub
parent 9ffa9136e8
commit aff3329e40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,7 +162,6 @@ export class BoxIconElement extends HTMLElement {
} }
this._state = { this._state = {
$iconHolder: this.$ui.getElementById('icon'), $iconHolder: this.$ui.getElementById('icon'),
type: this.getAttribute('type')
}; };
} }
@ -211,6 +210,9 @@ export class BoxIconElement extends HTMLElement {
} }
connectedCallback() { connectedCallback() {
this._state = {
type: this.getAttribute('type')
};
if (usingShadyCss()) { if (usingShadyCss()) {
GLOBAL.ShadyCSS.styleElement(this); GLOBAL.ShadyCSS.styleElement(this);
} }