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

Elements rendered outside of slot when shadow not enabled #2641

Closed
Jbcampbe opened this issue Aug 17, 2020 · 5 comments · Fixed by #4719
Closed

Elements rendered outside of slot when shadow not enabled #2641

Jbcampbe opened this issue Aug 17, 2020 · 5 comments · Fixed by #4719
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil slot-related

Comments

@Jbcampbe
Copy link

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:
I am seeing the behavior described in #897. The only difference is I do not have shadow enabled. If I enable shadow I see the correct behavior.

Expected behavior:
Children added to a slot after initial render should show up inside the designated slot.

Steps to reproduce:

Related code:

Other information:

@ionitron-bot ionitron-bot bot added the triage label Aug 17, 2020
Jbcampbe pushed a commit to Jbcampbe/genesys-webcomponents that referenced this issue Aug 31, 2020
Jbcampbe pushed a commit to Jbcampbe/genesys-webcomponents that referenced this issue Oct 13, 2020
@claviska claviska added Awaiting Reply This PR or Issue needs a reply from the original reporter. and removed triage labels Nov 18, 2020
@claviska
Copy link
Contributor

Hi, the linked issue is pretty old and was closed out. If this is still affecting you, can you provide a test case so we can replicate it? Thanks!

@johnjenkins
Copy link
Contributor

johnjenkins commented Nov 26, 2020

I see this issue too :)
image
^ there's the effect.
https://github.com/johnjenkins/stencil-scoped-append-bug
^ there's a minimum repro

When the component gets re-rendered the newly added elements will be re-positioned.
So a workaround is to add a mutation observer on the component then force a re-render by changing an arbitrary state variable or something.

@claviska claviska added bug and removed Awaiting Reply This PR or Issue needs a reply from the original reporter. labels Nov 30, 2020
@claviska
Copy link
Contributor

claviska commented Nov 30, 2020

Thanks for the repo. I've confirmed that this occurs when:

  • Shadow DOM is not used
  • An element is appended to a component with a <slot> via insertAdjacentHTML('beforeend', ...), el.appendChild(...), and also el.innerHTML += '...'

@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Dec 30, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 30, 2020

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

@ionitron-bot ionitron-bot bot closed this as completed Dec 30, 2020
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 30, 2020
@claviska claviska reopened this Dec 30, 2020
@claviska claviska removed the ionitron: stale issue This issue has not seen any activity for a long period of time label Dec 30, 2020
@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Jan 29, 2021
@rwaskiewicz rwaskiewicz added Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team and removed Feature: Renderer ionitron: stale issue This issue has not seen any activity for a long period of time labels Mar 25, 2022
@rwaskiewicz rwaskiewicz added Bug: Validated This PR or Issue is verified to be a bug within Stencil slot-related and removed Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team labels Jul 24, 2023
@rwaskiewicz
Copy link
Contributor

The fix for this issue has been released as a part of today's v4.2.0 release. To enable it, please ensure that experimantalSlotFixes (Docs) is set to true in your stencil.config.ts file. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil slot-related
Projects
None yet
4 participants