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

querySelector pseudo class :has not working #1373

Open
guenichone opened this issue Mar 27, 2024 · 0 comments
Open

querySelector pseudo class :has not working #1373

guenichone opened this issue Mar 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@guenichone
Copy link

Describe the bug
:has pseudo selector in query does not seem to be supported.

w3c spec: https://www.w3.org/TR/selectors-4/#has-pseudo

working sample: https://try.jsoup.org/ with query : p:has(a[href*=jsoup])

To Reproduce
Steps to reproduce the behavior:

Create a test with

const {container} = render(<html>
            <head>
                <title>Try jsoup</title>
            </head>
            <body>
            <p>This is <a href="https://jsoup.org/">jsoup</a>.</p>
            </body>
            </html>
        );

const result1 = container.querySelector('a') // this is not null
const result2 = container.querySelector('p:has(a[href*=jsoup])') // this is null where it should not

image

Expected behavior
result should give me back the

element in the
image

Device:

@guenichone guenichone added the bug Something isn't working label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant