]> git.ardis.lu - utf-8-visualizer/commitdiff
Move instantiation logic to `connectedCallback`
authorArdis Lu <ardisglu@gmail.com>
Tue, 8 Jul 2025 02:17:17 +0000 (19:17 -0700)
committerArdis Lu <ardisglu@gmail.com>
Tue, 8 Jul 2025 02:17:17 +0000 (19:17 -0700)
Reference: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance

script.js

index 2393fe48f44655d13606626585f0f6367330c94b..164b3c0d6d33db43e1b89a716fe91ef8622c06ea 100644 (file)
--- a/script.js
+++ b/script.js
@@ -4,8 +4,7 @@ const invisibleCharacters = [9, 10, 11, 12, 13, 32, 127, 160, 173, 847, 1564, 44
 const encoder = new TextEncoder();
 
 customElements.define('al-point-visualization', class extends HTMLElement {
-  constructor() {
-    super();
+  connectedCallback() {
     const template = document.querySelector('template').content;
     const shadowRoot = this.attachShadow({ mode: 'open' });
     shadowRoot.appendChild(template.cloneNode(true));
This page took 0.031718 seconds and 4 git commands to generate.