Subscribe on changes!

Vue3 XPath not searchable without wrapping the text in html element

avatar
Nov 22nd 2023

Vue version

3.3.8

Link to minimal reproduction

https://play.vuejs.org/#eNqdVE1v2kAQ/Svb7YFWiu0E2gslKE0bqe0hrZpI7cEXYw/gZL+0OyZEiP/e2V0whpCoygl23sy+N7NvvOKfjUkXDfAhH7nS1gaZA2zMOFe1NNoiuwWHlw2iVmxqtWS9NNuFfGmvTV0xC1O23uRFKFelVg6ZdDN27vF3vW8ghGZ/tBXVm977XI2yyEycdECQRhQIdGJsND8br1aheL0eZXQK0VqZBtkikboCcZ5zwnMeygncqQvJjH2FadEIZAm71sgetL2v1Sykdjp5troVxN46ofE0SgiIM4Ua31AwOfPt+GtZrdhfU+CcmvLo5o6s7cofX83db7kDaz80dMj8hPII3R5KR4ePApgrtYEq5IcJn7BJfPhVvLOqHdU8DtlE6PL+UwyaoqqIfsg+muUmJAs7q1Uy0VQsh6x/ukHW4a091ZifcCQ6Na1n6Z3TivwXSHJeamlqAfanwZqck/Phlj7nBRnn4UeIoW3gZBsv51DeH4nfuaWP5fyXBQd2ATlvMSSRgBG+urmGJf1vQTJWIyj7BfA3OC0arzGmXTaqItmdvKD2e1gNGtCtu1oiKLdtygsNQwn5Oad1+fJC6zu5g3SwGeaapri/i36N9989vuDWT95FY3oD/9MJMVVIoD2KBqdValO2STsvHyvpd0ui+zYVz5EMwr4+2aPBUUcf7FLLM8ra7jqGpqHE71EiC3NgrgjsT5bGFl9wjmjcMMvKSlEZfVnqhU0VYKaMzC4oLbONwlpCUml5MUg/pKdJIcy8SM8yWg3swik4mUysfiDbpcbqim7sWMNfFgxpEwuqAuuN838aDsqO6ThI2dPiZbT2Wf8DLFz+Yw==

Steps to reproduce

  1. Open Go to provided SFC playground
  2. Open developers tools and go to Element
  3. Search xpath - //*[contains(text(),'Slot-1 Working')] Expected to find the element

Bug - Not working

  1. Search xpath - //*[contains(text(),'Default - Not working')]
  2. Search xpath - //*[contains(text(),'Slot-2 Not Working')]
  3. Search xpath - //*[contains(text(),'Slot-3 Not Working')]
slot-xpath

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

avatar
Nov 23rd 2023

I believe it's not related to Vue. In your reproduction: