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

feat(create-context): don't use Shadow Root. #453

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-crabs-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"haunted": patch
---

Don't use Shadow Root for contexts.
2 changes: 1 addition & 1 deletion src/create-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function makeContext(component: ComponentCreator): Creator {
const context = useContext(Context);

return render(context);
}),
}, { useShadowDOM: false }),

defaultValue,
};
Expand Down
2 changes: 1 addition & 1 deletion test/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('context', function() {
}

function getContentResults(selector: string) {
return [...document.querySelector('context-tests').shadowRoot.querySelectorAll(selector)].map((consumer) => (consumer).shadowRoot.textContent);
return [...document.querySelector('context-tests').shadowRoot.querySelectorAll(selector)].map((consumer) => (consumer).textContent);
}

beforeEach(async () => {
Expand Down