-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Update visibility check for position: fixed
combined with pointer-events: none
#8095
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
position: fixed
combined with pointer-events: none
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the original issue. 👍 Just had some comments about the tests.
|
||
this.$parentPointerEventsNone = add(`\ | ||
<div style="pointer-events: none;"> | ||
<span style="position: fixed; top: 20px;">parent pointer-events: none</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't tell this HTML from the HTML below it on the page since it's the same content.
<span style="position: fixed; top: 20px;">parent pointer-events: none</span> | |
<span style="position: fixed; top: 20px;">parent pointer-events: none; top: 20px</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be updated now with the self-contained covering element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Much clearer now in the tests.
Ignoring percy visual change as it is a timing issue - the collapsible is not fully opened, so that'll need to be addressed elsewhere. |
position: fixed
elements having parent withpointer-events: none
mistakenly display as not visible / covered by another el #6675User facing changelog
Fixes a bug where
position: fixed
combined withpointer-events: none
can cause an element to be reported as hidden when it is actually visibleAdditional details
document.elementFromPoint
ignores elements that havepointer-events: none
, and gets the element underneath instead. Previously, we would just check that that element was the same element or a descendant of the one we were trying to check. This adds another check if the element is a parent, which covers the case that the click fell through (and due to the other checks beforehand, does not accidentally misreport a hidden element as visible).PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?