-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[BUG] Child of display:contents
element not visible to Playwright
#5949
Comments
display:contents
element not visible to Playwright
Could you try latest Playwright v1.10? We had a fix for display:contents there. |
Gave that a try, it was still unable to find the visible selector on 1.10! |
Closing as dupe of #5858 |
This issue is still not resolved. Context:
Code Snippet: <div class="wrapper">
Checkbox: <input type="checkbox" id="myCheck" onclick="myFunction()">
<footer id="parent" style="display:none">
<p id="child" style="display:contents">Checkbox is CHECKED!</p>
</footer>
</div>
<script type = "text/javascript">
function myFunction() {
const checkBox = document.getElementById("myCheck");
if (checkBox.checked == true) {
pagefooter.style.display = "block";
} else {
pagefooter.style.display = "none";
}
}
</script> await page.waitForSelector('.child')
|
@basilgood could you please file a new issue with a repro script? thanks! |
Yes thank you. |
Context:
Playwright Version: 1.8.1
Operating System: Linux, Mac
Node.js version: 12.13.1
Browser: Chromium
System:
OS: macOS 11.2.3
Memory: 104.15 MB / 16.00 GB
Binaries:
Node: 12.13.1 - /usr/local/bin/node
Yarn: 2.4.0 - /usr/local/bin/yarn
npm: 6.12.1 - /usr/local/bin/npm
Languages:
Bash: 3.2.57 - /bin/bash
Code Snippet
Describe the bug
It seems that if a layer is the child of a layer with
style.display = "contents"
, callingwaitForSelector(
.child, { state: "visible" })
Playwright doesn't believe the layer is visible. The issue can be worked around by using{ state: "attached" }
.The same is true if
waitForSelector
is called on the parent, but this makes sense based on the implementation, which expects a bounding box, and elements withdisplay: contents
do not have a box, instead taking on the box of their contents, but is still not desired behaviour: https://developer.mozilla.org/en-US/docs/Web/CSS/display#box perhaps the accessibility issues are impacting this?Apologies for the over-simplified code snippet, this extracted from a company code base.
The text was updated successfully, but these errors were encountered: