Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
crisward committed Jun 3, 2023
1 parent 3d096ab commit 92d201e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function createSlots(slots) {
return {
c: noop,
m: function mount(target, anchor) {
insert(target, element.cloneNode(true), anchor);
insert(target, element.cloneNode(true), anchor);
},
d: function destroy(detaching) {
if (detaching && element.innerHTML){
d: function destroy(detaching) {
if (detaching && element.innerHTML){
detach(element);
}
}
},
l: noop,
};
Expand All @@ -42,7 +42,7 @@ export default function(opts){
let link = document.createElement('link');
link.setAttribute("href",opts.href)
link.setAttribute("rel","stylesheet")
root.appendChild(link);
root.appendChild(link);
}
if(opts.shadow){
this._root = document.createElement('div')
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function(opts){
}
try{ this.elem.$destroy()}catch(err){} // detroy svelte element when removed from dom
}

unwrap(from){
let node = document.createDocumentFragment();
while (from.firstChild) {
Expand All @@ -95,7 +95,7 @@ export default function(opts){
const namedSlots = this.querySelectorAll('[slot]')
let slots = {}
namedSlots.forEach(n=>{
slots[n.slot] = n
slots[n.slot] = this.unwrap(n)

This comment has been minimized.

Copy link
@patricknelson

patricknelson Jun 3, 2023

Contributor

This was what issue #12 fixed. The unit test just broke because I needed to update the Vitest code to test the new output code. If you want later today when I’m at a computer, I can reissue a PR that does what #12 did again but with the proper Vitest unit tests.

This comment has been minimized.

Copy link
@patricknelson

patricknelson Jun 3, 2023

Contributor

PR #13 that is 😅

this.removeChild(n)
})
if(this.innerHTML.length){
Expand Down Expand Up @@ -144,6 +144,6 @@ export default function(opts){
this.elem.$set({[name]:newValue})
}
}
}
}
window.customElements.define(opts.tagname, Wrapper);
}

0 comments on commit 92d201e

Please sign in to comment.