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

Can't waitForSelector if the selector contains :focus or something else exotic #23

Closed
JoelEinbinder opened this issue Nov 19, 2019 · 1 comment

Comments

@JoelEinbinder
Copy link
Contributor

When we do waitForSelector, we poll on DOM mutations. But some things that can change the selectors an element matches against aren't DOM mutations. For example:

const focusedButtonPromise = page.waitForSelector('button:focus');
await page.focus('button');
// times out, because focus doesnt trigger a DOM mutation.
const focusedButton = await focusedButtonPromise; 

Would also effect

  • :focus-within
  • :active
  • :hover
  • :visited (currently broken for other reasons)
  • :empty
  • :valid

Maybe others.

I don't really want to wait on focus changes or value changes for every waitForSelector. Maybe a quick hack that also waits on rafs when the selector contains ":"?

@dgozman
Copy link
Contributor

dgozman commented Feb 27, 2020

We are not going to support pseudo states in waitForSelector.

@dgozman dgozman closed this as completed Feb 27, 2020
sand4rt pushed a commit to sand4rt/playwright that referenced this issue Dec 21, 2022
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

3 participants