-
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
Visibility overflow detection doesn't work as expected when a child element has position:absolute #755
Comments
Will look into this. We actually take this into account when performing the calculations. Will see what needs to be updated. Here is the visibility code: And the associated tests: |
@brian-mann Thanks, I noticed there's a related test case, will read the code to find some clues. |
There are quite a few issues tagged as 'topic: visibility', it needs a lot of ❤️ . https://github.com/cypress-io/cypress/labels/topic%3A%20visibility |
@brian-mann I found the logic here a bit confusing: https://github.com/cypress-io/cypress/blame/develop/packages/driver/src/dom/visibility.coffee#L185 Should the logic be "or" instead of "and"? |
Are there any updates on this issue? |
@liuyangcharlie do you mind posting a reproducible example - as minimal as possible to show how Cypress incorrectly interprets elements as not visible? |
Verified, the test case in the original post is still failing in Cypress 3.2.0 |
Closing as duplicate of #4395 |
* Add failing test case for visible element within overflow hidden then position absolute element. Addresses #4395 * Write failing test case for when parent is flex and overflow hidden with el outside bounds Addresses #4161 * Wrote failing test for visibility outside of clip-path Addresses #1178 * Add failing tests for transform scale Addresses #723 * Add failing test for backfact-visibility hidden example * cs -> js fixes * Add more specific error when el is not element * Always return as visible when checking html or body * Add comments + rename methods to be more exact * Add case for isHidden when visibility is collapse * Add failing test cases for visibility issues * Add comment about how ensureVisibility works under the hood * Add checks and tests for opacity: 0 to be hidden * Simplify if/case statements to be more readable * Expand check for offset parents to also check children of ancestor for positioning attributes close #4395 close #755 * Fix issue where els with parents with absolute position inside overflow hidden would be calculated as not visible * comment out opacity checks for patch release * Add more tests around new visibility assertions - Add case to make sure display none is not on the option or optgroup itself * Fix failing assertion - where el was undefined when looking for visibiliyt * remove commented out code involving opacity 😬
Released in |
Current behavior:
If an child element which has 'position: absolute' is placed in a parent element which contains 'overflow: hidden', the input elements in the child element will be consider not visible by cypress. But from end user perspective, it is visible and interactable.
Desired behavior:
The visibility detection should consider this case and consider those input elements in a 'position: absolute' child element being visible.
How to reproduce:
Repo created to demonstrate the issue:
https://github.com/bencao/cypress-visibility-detection-issue
A fiddle page which contains the above parent/child elements:
https://jsfiddle.net/benb88/8j89jbzh/3/
Test code:
The text was updated successfully, but these errors were encountered: