Vue3 XPath not searchable without wrapping the text in html element
Vue version
3.3.8
Link to minimal reproduction
Steps to reproduce
- Open Go to provided SFC playground
- Open developers tools and go to Element
- Search xpath - //*[contains(text(),'Slot-1 Working')] Expected to find the element
Bug - Not working
- Search xpath - //*[contains(text(),'Default - Not working')]
- Search xpath - //*[contains(text(),'Slot-2 Not Working')]
- Search xpath - //*[contains(text(),'Slot-3 Not Working')]
What is expected?
Expected that generated text or element from slots are searchable via xpath. text and elements are searchable in Vue2.
What is actually happening?
They are not searchable unless you modify the text manually from developer tools and then search again.
System Info
No response
Any additional comments?
No response
I believe it's not related to Vue. In your reproduction:
Slot-3 Not Working in Xpath
actually works.- The XPath doesn't do what you expects it to do: see https://stackoverflow.com/a/3655588