From 77f5e81d0a1adc497040eaa89095635f3de3924e Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 28 Jul 2025 08:52:51 -0400 Subject: attach octave values to frets sometimes just do the simple thing --- tests.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests.mjs') diff --git a/tests.mjs b/tests.mjs index e7095f8..1dc4c09 100644 --- a/tests.mjs +++ b/tests.mjs @@ -5,12 +5,16 @@ customElements.define('x-string', class extends HTMLElement { constructor() { super(); console.debug('x-string#constructor', this); - const template = this.querySelector('template').content; - const shadowRoot = this.attachShadow({mode: 'open'}).appendChild(template.cloneNode(true)); - console.debug('attached', template, 'to shadow root', shadowRoot); this.muted.onclick = this.muteClicked.bind(this); this.tonic.onclick = this.fretClicked.bind(this); + this.attachShadow({mode: 'open'}); + } + + connectedCallback() { + const template = this.querySelector('template').content; + this.shadowRoot.appendChild(template.cloneNode(true)); + console.debug('attached', template, 'to shadow root', shadowRoot); } get tonic() { -- cgit v1.3