-
Notifications
You must be signed in to change notification settings - Fork 795
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
Slot name is not updated when it is bind to a prop #2982
Comments
Hey there, thank you for the patience getting back to you. The new team is getting started and we're working through the backlog now. Could we get a reproduction case? Are you using scoped component or shadow components? |
I also ran into this issue a while back, so I could make a repro case:
Here's a codesandbox of it: There's also a workaround in there, which works by embedding the slot into another element using innerHTML. And here it is working as expected in Stencil <2, as mentioned by @mergin: |
Here is an alternative workaround, if // workaround for https://github.com/ionic-team/stencil/issues/2982
@Watch('active') updateActive(active?: string) {
if (!active) return;
const slot = this.host.shadowRoot?.querySelector('slot');
if (slot) {
slot.name = active;
}
} |
I was able to reproduce this issue, much thanks @OscarBouwmans for the reproduction case! I'm going to label this to get ingested into the team's backlog |
The fix for this was just released today in Stencil v4.12.1! |
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
The slot name is not updated when it is bind to a prop, so it can show only the slotted element that matches de name.
Then, in the HTML
Expected behavior:
The slot name should dynamically change.
Steps to reproduce:
Other information:
This used to work in versions <2.0.0. After upgrading my repo to version 2.6.0, this stopped working.
The text was updated successfully, but these errors were encountered: