Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #12 (take 2): Ensure original named slot tags are retained when not using shadow root. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patricknelson
Copy link
Contributor

@patricknelson patricknelson commented Jun 5, 2023

This is a second attempt at addressing issue #12. This is required to account for new unit testing framework (Vitest) was was merged from PR #14.

Easier to review while hiding whitespace (since my editor trims trailing whitespace, which the current file still has a little bit of): https://github.com/crisward/svelte-tag/pull/15/files?diff=unified&w=1

…en not using shadow root. Take 2 required to account for new unit testing framework (Vitest) from PR #14.
@@ -95,7 +95,7 @@ export default function(opts){
const namedSlots = this.querySelectorAll('[slot]')
let slots = {}
namedSlots.forEach(n=>{
slots[n.slot] = this.unwrap(n)
slots[n.slot] = n
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the primary change (which includes the wrapping <div slot="inner"> which is typical in normal Svelte output when using named slots).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant