You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#8954 changed waitForSelector "visible" flag behavior to consider only elements inside the current viewport as visible. This was reverted in #9087, but it looks like the revert wasn't complete. Apparently elements below the current viewport are now considered "visible", but not elements above (or left) of the current viewport.
Simple script to reproduce (works with 17.1.3, fails with 19.2.2):
constpuppeteer=require('puppeteer');(async()=>{constbrowser=awaitpuppeteer.launch({headless: false});constpage=awaitbrowser.newPage();awaitpage.setViewport({width: 800,height: 600});awaitpage.setContent(` <html><body> <button id="button1">Button 1</button> <div id="content" style="height: 2000px;"></div> <button id="button2">Button 2</button> </body></html> `);awaitpage.waitForSelector('#button1',{visible: true});awaitpage.waitForSelector('#button2',{visible: true});console.log('ok, both buttons are visible');awaitpage.evaluate(()=>window.button2.scrollIntoView());awaitpage.waitForSelector('#button1',{visible: true});console.log('ok, button1 still visible (although outside viewport)');awaitbrowser.close();})();
Puppeteer version
19.2.2
Node.js version
16.18.0
npm version
8.19.2
What operating system are you seeing the problem on?
macOS
Configuration file
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Bug description
#8954 changed waitForSelector "visible" flag behavior to consider only elements inside the current viewport as visible. This was reverted in #9087, but it looks like the revert wasn't complete. Apparently elements below the current viewport are now considered "visible", but not elements above (or left) of the current viewport.
Simple script to reproduce (works with 17.1.3, fails with 19.2.2):
Puppeteer version
19.2.2
Node.js version
16.18.0
npm version
8.19.2
What operating system are you seeing the problem on?
macOS
Configuration file
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: