From 9aa5c222819991d0c1c0eba1341ebd7d21391813 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Fri, 4 Nov 2022 11:09:52 +0200 Subject: [PATCH 1/3] feat(create-context): don't use Shadow Root. The Context's Consumer component does not need to have a ShadowRoot because it would be very hard to style elements inside it. (part) fixes #384 --- src/create-context.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create-context.ts b/src/create-context.ts index 5a624a1..c9eecc8 100644 --- a/src/create-context.ts +++ b/src/create-context.ts @@ -76,7 +76,7 @@ function makeContext(component: ComponentCreator): Creator { const context = useContext(Context); return render(context); - }), + }, { useShadowDOM: false }), defaultValue, }; From f359e21d476fd46d123b16d76e53b9c8c22b05c5 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Wed, 15 Mar 2023 07:27:41 +0200 Subject: [PATCH 2/3] Create .changeset/polite-crabs-admire.md --- .changeset/polite-crabs-admire.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/polite-crabs-admire.md diff --git a/.changeset/polite-crabs-admire.md b/.changeset/polite-crabs-admire.md new file mode 100644 index 0000000..243f924 --- /dev/null +++ b/.changeset/polite-crabs-admire.md @@ -0,0 +1,5 @@ +--- +"haunted": patch +--- + +Don't use Shadow Root for contexts. From 4cb9621a78dd236e1d74aad198d5c895a3f669c8 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Mon, 15 May 2023 13:57:43 +0300 Subject: [PATCH 3/3] fix: adjust test --- test/context.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/context.test.ts b/test/context.test.ts index 024fc3c..569ec71 100644 --- a/test/context.test.ts +++ b/test/context.test.ts @@ -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 () => {