[Feature] waitForSelector hidden with debounce
See original GitHub issueHello, is it possible to perform a waitForSelector
until something is hidden even if it rapidly appears and disappears multiple times? This would be similar to a debounce feature or very much like the waitForLoadState
with networkidle
selected. I would want to set the debounce to something like 500 milliseconds but have it configurable.
I have looked in the issues and couldn’t find anything like this but this would help with loading divs and animations that popup multiple times to ensure that we don’t execute the next statement until the threshold has been met.
Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to make puppeteer wait for page to load - Urlbox
waitForSelector () to wait for an element to be present, visible, ... observers callback function, we can use a debounced function that will ......
Read more >puppeteer: how to wait until an element is visible?
I think you can use page.waitForSelector(selector[, options]) function for that purpose. const puppeteer = require('puppeteer'); ...
Read more >Debounce JavaScript – How to Make your JS Wait Up
The debounce method here takes in two arguments, callback & wait . callback is the function you want to execute, while wait is...
Read more >What's new in Gutenberg 13.1? (27 April) - Make WordPress
Categories: Added new option to show or hide empty categories. ... Add a debounce to the custom color onChange event.
Read more >mozilla-central: changeset 603618 ...
waitForSelector should wait for visible recursively (waittask.spec.ts)": [ @@ -2080 ... version of Chrome using the latest JavaScript and browser features.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @yury-s thanks for the sample! I tried it out and it worked exactly as I expected. I made a slight modification so that I could pass in the timeout:
Thanks again for your help! Having debounce with multiple busy indicators displaying rapidly makes it so much nicer to test.
@mattduffield Apologies for posting bad example. I can see that Yury already provided you working code, but let me also finish my try 😃
Tested it with static elements (not appearing many times), but should work for you.