-
Notifications
You must be signed in to change notification settings - Fork 794
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: Component markup disappears when overwriting default slot using text #3977
Comments
Also this is not related with beta version, also happening in 2.13 |
We are having the same issue in our project and it's a huge blocker. Could you pls prioritize slot-related issues? @rwaskiewicz |
just chiming in to say you can achieve what you need now by enabling the |
Hi @johnjenkins , Many thanks for pointing the extras config, I wasn't aware of it. I see that you linked the issue to a PR, did you test components without shadowDOM and without scopedCSS in your branch? I was assuming stencil would work in the same mode and output the same code & behaviour for the following cases:
I see that more or less the first 2 cases are working similar with the scopedSlotTextContentFix option set to true. |
hm that's odd. |
Hey @oscargm 👋 Just took a look at your repro and fiddled with the recommendations @johnjenkins posed. Does look like enabling that Thanks for reporting the issue! |
Hey, many thanks for dedicating some time.on validating the bug. @yigityuce found out that patchTextContent function execution in dom-extras was only executed with scopedCSS and the flag enabled. |
Hey @tanner-reits ! As @oscargm mentioned we implemented custom polyfill for the components, I am planning to create a PR and if it is okay for you I would like to assign it to you for your reviews. |
This commit updates our patch for `textContent` to mimic the Shadow Root implementation Fixes: #3977 STENCIL-687
* only patch scoped components * patch `textContent` for `scoped` components This commit updates our patch for `textContent` to mimic the Shadow Root implementation Fixes: #3977 STENCIL-687 * fix e2e tests for new implementation * ignore comment nodes in getter * fix issue with removing multiple nodes in slot for setter * add e2e tests for `textContent` patch * re-add build flag checks
Hey there 👋 we have released a Stencil version |
Prerequisites
Stencil Version
3.0.0-beta.1
Current Behavior
When the following component is defined:
When modifying default slot content using javascript:
All the markup inside disappears and only the text remains.
Expected Behavior
Same as with shadow DOM
System Info
Steps to Reproduce
Download the linked repository, install, start the project, and type into the input element
Code Reproduction URL
https://github.com/oscargm/stencil-slot-problem
Additional Information
In the reporduction repository you'll find a demo using components with:
If this is the intended behaviour I'd like to know how to avoid this issue.
I found out that adding a span like htis:
and changing the text of the span everything works fine, or even with the prefix/suffix named slots changing the textContent or innerText it works fine.
The text was updated successfully, but these errors were encountered: