mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(html): move TimeElement child creation from constructor to connectedCallback (#1209)
This commit is contained in:
@@ -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!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user