Description
Where the bug happens
- Browser Extension
- Library
- Other
your browser
Chrome v133.0.6943.99
Describe the bug
LocatorJS is unable to correctly map Vue components when the content is passed via a slot. If a parent component passes elements to a child component using a <slot>
, LocatorJS identifies the DOM as part of the child component instead of tracing it back to the parent component where the slot content originates.
Steps to Reproduce
-
Create a parent component that passes content via a slot:
<!-- Parent.vue --> <template> <Child> <div class="content">Hello</div> </Child> </template>
-
Create a child component that renders the slot:
<!-- Child.vue --> <template> <div class="wrapper"> <slot></slot> </div> </template>
-
Use LocatorJS to locate the
<div class="content">Hello</div>
element.
Expected Behavior
LocatorJS should trace the source of the slot content back to Parent.vue
, since that’s where it is defined.
Actual Behavior
LocatorJS instead associates the slot content with Child.vue
, making it difficult to locate the original definition in Parent.vue
.
Environment
- Vue Version: 3.4.31
- LocatorJS Version: 1.3.2
- Browser: Chrome 133.0.6943.99
- OS: Windows 11
Would appreciate any insights on how to resolve this issue. Thanks!