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

bug: experimentalSlotFixes (and slotChildNodesFix / scopedSlotTextContentFix) broken #6054

Closed
3 tasks done
johnjenkins opened this issue Nov 22, 2024 · 1 comment · Fixed by #6055
Closed
3 tasks done
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@johnjenkins
Copy link
Contributor

johnjenkins commented Nov 22, 2024

Prerequisites

Stencil Version

latest

Current Behavior

Add

extras: {
    experimentalSlotFixes: true,
    // or individually
    slotChildNodesFix: true,
   scopedSlotTextContentFix: true,
  },

to stencil.config.

Then do something like document.querySelector("my-component").childNodes - where 'my-component' is scoped: true.
The nodelist returned will be the 'internal' nodes as rendered within the component.

Additionally, scopedSlotTextContentFix does not adhere to "return values described in MDN's article on textContent" < as described in the Stencil documentation.

Expected Behavior

According to the documentation document.querySelector("my-component").childNodes

  • where 'my-component' is scoped: true - shouljd only return the nodes that were slotted, not the internal, component rendered, nodes (and the same with children / slotted elements)

scopedSlotTextContentFix should "return values described in MDN's article on textContent" < as described in the Stencil documentation.

System Info

No response

Steps to Reproduce

add

extras: {
    experimentalSlotFixes: true,
    // or individually
    slotChildNodesFix: true,
    scopedSlotTextContentFix: true,
  },

to stencil.config, build components then do .childNodes / .children / .textContent on a scoped: true component

Code Reproduction URL

https://codesandbox.io/p/devbox/stencil-web-component-forked-ds6rj3?workspaceId=72400648-5e20-4c72-af8a-d0ff6c9d8a44

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 22, 2024
@johnjenkins johnjenkins changed the title bug: experimentalSlotFixes (and slotChildNodesFix) broken bug: experimentalSlotFixes (and slotChildNodesFix / scopedSlotTextContentFix) broken Nov 25, 2024
@christian-bromann christian-bromann added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed triage labels Nov 26, 2024
@christian-bromann
Copy link
Member

christian-bromann commented Dec 11, 2024

A fix for this was released in Stencil v4.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants