diff --git a/src/auto-shadow-root.ts b/src/auto-shadow-root.ts index 2b0d191d..c30fb0e7 100644 --- a/src/auto-shadow-root.ts +++ b/src/auto-shadow-root.ts @@ -5,7 +5,7 @@ export function autoShadowRoot(element: HTMLElement): void { .attachShadow({ mode: template.getAttribute('data-shadowroot') === 'closed' ? 'closed' : 'open' }) - .appendChild(template.content.cloneNode(true)) + .append(template.content.cloneNode(true)) } } } diff --git a/src/bind.ts b/src/bind.ts index d19d7576..fcb1b8a0 100644 --- a/src/bind.ts +++ b/src/bind.ts @@ -38,7 +38,7 @@ export function listenForBind(el: Node = document): Subscription { } } }) - observer.observe(el, {childList: true, subtree: true, attributes: true, attributeFilter: ['data-action']}) + observer.observe(el, {childList: true, subtree: true, attributeFilter: ['data-action']}) const subscription = { get closed() { return closed @@ -94,10 +94,11 @@ function* bindings(el: Element): Iterable { for (const action of (el.getAttribute('data-action') || '').trim().split(/\s+/)) { const eventSep = action.lastIndexOf(':') const methodSep = action.lastIndexOf('#') - const type = action.slice(0, eventSep) - const tag = action.slice(eventSep + 1, methodSep) - const method = action.slice(methodSep + 1) - yield {type, tag, method} + yield { + type: action.slice(0, eventSep), + tag: action.slice(eventSep + 1, methodSep), + method: action.slice(methodSep + 1) + } } }