Skip to content

Discrepancy in parent resolving for vue custom element and vue component #12479

Closed

Description

@lejunyang

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNqdVMFu2zAM/RVNFydAlhy2U5Z2WINg2A5bsA07+WLYTKpUlgRJ9lIY/vdRkuMKrusGvUnkE/n4SKqhX5Ra1hXQNd2YXDNliQFbqdtUsFJJbclXnYlin2kQlhy0LEmyXEU29zj51KMHwFHM9p7xoof42wDRkAIOTMC2MlaWOw6lC9p2bzosog9k9i6PMWZ5BDtLysf3R0cxmc/JwB8CR5DFWK5ZVOF8Pp1JedR0qg4znuu6NLnTaTpLgIwn8TK7HKnYrEKnscd4sVAqnlnAGyGbgtW3fyvYrNzBWyIlvAFNoYGr4I+HwUfsomx3UZCL2iQPeYLJ8+3jXDB43awiVnRBrcmlOLDj8mSkwFFt3IuU5rJUjIP+qSyTwqR0TbzH+TLO5b/v3mZ1BYuLPb+H/GHEfjJnZ0vpXoMBXUNKe5/NNHYhuHe/f8AZz72zlEXFET3h/AVG8spxDLC7ShRIO8J5tt/88DNx/GN2ZwvCXIpyRB2y9fiU4gJsJ0p/ovth+dG/S0WLKj4t48vb3hClZc0KeL5tnWOWPMAjDlkSwiU4Uq8NVNdxw6Xtux3sw0YPPpY38LzmH0oFjpOxLoQy5Kbbl727zbyKOazJnZQcMsS2WOGw9ojnawK4IZXCkVkzc4MDCOQzif4Esu7IpnRUqP79iFz93zklFBMnyEd+z6BBnfEKUIOACgVe3dKwwD4Ezl/TBWtx3l5qcfsfbOQ2YA==

Steps to reproduce

We can see from the inject texts:
image

In vue component, Child component's parent is "Parent', its actual slotted parent
but in custom element, Child component's parent is "GrandParent"

What is expected?

should have same behavior

What is actually happening?

For now in custom element, parent resolving is done by iterating parentNode and host, we should check assignedSlot first to get actual slotted parent in actual render tree order

System Info

No response

Any additional comments?

No response

Activity

  1. added
    🔨 p3-minor-bug
    on Nov 27, 2024
  2. added a commit that references this issue on Mar 9, 2026
    f06c81a
  3. locked and limited conversation to collaborators on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugscope: custom elements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions