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

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

Open
lejunyang opened this issue Nov 27, 2024 · 0 comments · May be fixed by #12480
Open

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

lejunyang opened this issue Nov 27, 2024 · 0 comments · May be fixed by #12480
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements

Comments

@lejunyang
Copy link

lejunyang commented Nov 27, 2024

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

lejunyang added a commit to lejunyang/core that referenced this issue Nov 27, 2024
@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements labels Nov 27, 2024
lejunyang added a commit to lejunyang/core that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants