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

Fails to query a selector with special chars #58

Open
shalev-kaveh opened this issue May 6, 2021 · 2 comments
Open

Fails to query a selector with special chars #58

shalev-kaveh opened this issue May 6, 2021 · 2 comments

Comments

@shalev-kaveh
Copy link

shalev-kaveh commented May 6, 2021

Hi @Georgegriff,
First of all thanks for sharing your code! I've been using it for a while and it's working well :)

I've come across, however, a corner case -
trying to query a selector in a shadowDOM in this website.
Querying this selector (each element of the array is a new shadowDom document)
["dps-app", "dps-home-unauth", "dps-card > img[slot="icon-custom"][height="\33 0"]"]
(please note that the last string is automatically backslashed \ into "dps-card > img[slot=\"icon-custom\"][height=\"\\33 0\"]")
image

works in the "classic" way to query shadow selectors:
document.querySelector("dps-app").shadowRoot.querySelector("dps-home-unauth").shadowRoot.querySelector("dps-card > img[slot=\"icon-custom\"][height=\"\\33 0\"]")​
image

However, trying to query it with queryDeep returns null:
(after converting into a queryDeep selector syntax - "dps-app dps-home-unauth dps-card img[slot=\"icon-custom\"][height=\"\\33 0\"]")
image

But, when removing the selector's last funky height attribute - it succeeds!
("dps-app dps-home-unauth dps-card img[slot=\"icon-custom\"]")
image

I'm not sure why it has failed to query with the height attribute, and would really appreciate your help with fixing it.
Thanks!

@shalev-kaveh
Copy link
Author

Hi @Georgegriff , do you have any lead?

@Georgegriff
Copy link
Contributor

Hey sorry, i've had a lot on at the moment, i will eventuaally get to this, in the mean time im always accepting of pull requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants