playwright: [BUG] Chromium: Cannot click, element intercepts pointer events
Context:
- Playwright Version: 1.20.0
- Operating System: Windows10
- Node.js version: LTS 16
- Browser: Chromium only
Describe the bug Trying to click on the ElementHandle, located by ElementHandle.waitForSelector() - fails in Chroimum with error
attempting click action
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
performing click action
<span class="selection">…</span> intercepts pointer events
Works fine in Webkit and Firefox, was working fine in all browsers before 1.20.0 upgrade.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 16 (4 by maintainers)
Hi @dgozman
Here’s a repro for the chromium issue. Steps to reproduce:
http-serverNPM package)repro.zip
As others have already observed, invoking the
click()on the ancestor that listens to the mouse event seems to work around the issue.Instead of figuring out complicated selectors, you might as well select your favorite element in your preferred way and then use XPath get to the interactive ancestor:
await page.locator('.myclass').first().locator('xpath=../..').click();- in this example, I’m clicking the element two levels above the “myclass” elementDefinitely not a solution, but hopefully saves someone’s precious time.
Thanks for the investigation and the workaround @dgozman. It fills me with joy to have “Romimine”, which is the name we gave to the cat living in our garden, now part of the codebase of Playwright and used to fix an issue in chromium. 😂