fix(html): move TimeElement child creation from constructor to connectedCallback (#1209)

This commit is contained in:
Wesley Luyten
2026-04-02 23:40:28 -05:00
committed by GitHub
parent 5a3254fd81
commit 4ee55c08bd
+7 -10
View File
@@ -25,19 +25,16 @@ export class TimeElement extends MediaElement {
readonly #signSpan = document.createElement('span');
readonly #textNode = document.createTextNode('');
constructor() {
super();
this.#signSpan.setAttribute('aria-hidden', 'true');
this.#signSpan.hidden = true;
this.appendChild(this.#signSpan);
this.appendChild(this.#textNode);
}
override connectedCallback(): void {
super.connectedCallback();
if (!this.#signSpan.parentNode) {
this.#signSpan.setAttribute('aria-hidden', 'true');
this.#signSpan.hidden = true;
this.appendChild(this.#signSpan);
this.appendChild(this.#textNode);
}
if (__DEV__ && !this.#state.value) {
logMissingFeature(this.localName, this.#state.displayName!);
}