Skip to content

Slot components render wrong order of slot children on state change #757

Closed

Description

@corysmc

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://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:
If a slot component has content that is dynamically generated, it's order is changed on state change.
(I think it's reverse order).

Expected behavior:
Content should be rendered in the same order it is declared inside the render function.

Steps to reproduce:

  1. create a new component with a <slot /> inside it
  2. add that component to a parent component
  3. add content inside the slot component: e.g. map over data or something that can be dynamically changed
  4. change state of the content on load
  5. observe order of dom

Related code:
This demo uses ionic:
https://github.com/corysmc/stencil-bug-demo/tree/slots-debug

This is a Stencil only demo:
https://github.com/corysmc/stencil-bug-demo/tree/content-reordered

Activity

  1. adamdbradley commented on Apr 26, 2018

    @adamdbradley
    Contributor

    Fixed in 39d1afe

  2. self-assigned this
    on Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions