Repository navigation
Description
Stencil version:
@stencil/[email protected]
---
update: 15.11.2019
---
@stencil/[email protected]
---
update: 15.01.2020
---
@stencil/[email protected]
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:
Here is a demo: https://dutscher.github.io/stencilslots/
Here is the code which doesnt work from with comments
render() {
const classes = [];
if (this.disabled) {
classes.push(`${this.componentName}--disabled`);
}
return (
<Host class={classes.join(' ')}>
Demonstrate slot rerender bug
{/* this dont rerender slot */}
<div>
{/* remove condition: works */}
{/* wrap with <div />: works */}
{this.disabled && !!this.tag && (
<div class="tag" innerHTML={this.tag}/>
)}
{/* remove div: works */}
<div>
before slot>
<slot/>
<after slot
</div>
</div>
</Host>
);
}The <slot /> renders first very well, when a rerender in the parent happens, the <slot /> going away. There is a ugly workarround, you can put a <div />. But logical you dont need this <div/>.
https://github.com/dutscher/stencilslots/blob/master/src/components/parent-workaround/parent.tsx
I got a scenario there i need more than one <div />.
I guess its a vdom diff problem.
Expected behavior:
TSX works without extra empty <div /> and the <slot /> is rendered after parent is rerendered.
Steps to reproduce:
https://dutscher.github.io/stencilslots/
Related code:
https://github.com/dutscher/stencilslots/blob/master/src/components/parent-broken/parent.tsx
https://github.com/dutscher/stencilslots/blob/master/src/components/parent-workaround/parent.tsx
Cheers and thanks for the attention :)
Activity
NKBelousov commentedon Dec 25, 2019
Just confirmed this myself
@dutscher have you found any workaround?
dutscher commentedon Jan 15, 2020
@NKBelousov the worked workarround was, to add enough
I updated the master with 1.8.5. The problem is still there!
https://dutscher.github.io/stencilslots/
cheers
dutscher commentedon Mar 3, 2020
updated to 1.8.10 and no fix for this.
add enough
cheers
Aswathprabhu commentedon Feb 2, 2021
Facing this in
1.17.3sajTempler commentedon Mar 23, 2021
possible workaround:
#2036 (comment)
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
1 remaining item
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
test(slot): add karma test for #1968
feat(runtime): automatically insert `key` attrs during compilation
feat(runtime): automatically insert `key` attrs during compilation (#…
rwaskiewicz commentedon Jan 29, 2024
The fix for this issue has gone out in today's v4.12.0 release