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
Currently we define visibility as an element that "could" be seen or interacted with by a user (even if its not currently in the viewport)
This is a "lax" check to avoid needing to scroll the viewport in order to determine an elements visibility (since this is a mutation).
I don't think it makes sense given that rule that we consider an element hidden if its within a container (other than window) that has to be scrolled first.
It seems we do it 1 way and then another way differently. That's confusing.
My suggestion is to relax visibility rules to account for the situation that if an element could be otherwise scrolled to from within a container with scroll, that we consider it visible.
I think as a general rule of thumb we should err on the side "thinking an element is visible when its not" vs "thinking an element is hidden when its not".
The text was updated successfully, but these errors were encountered:
We've since made decisions concerning visibility to address this issue. We consider an element visible only if it can be seen within the current viewport and offer the commands to scrollTo() or scrollIntoView() if you want to check their visibility.
Furthermore there is an issue opened to change the scroll behavior, so we will close this issue in favor of that. #871
I believe the offending logic is here:
https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/dom/visibility.coffee#L135
Currently we define visibility as an element that "could" be seen or interacted with by a user (even if its not currently in the viewport)
This is a "lax" check to avoid needing to scroll the viewport in order to determine an elements visibility (since this is a mutation).
I don't think it makes sense given that rule that we consider an element hidden if its within a container (other than window) that has to be scrolled first.
It seems we do it 1 way and then another way differently. That's confusing.
My suggestion is to relax visibility rules to account for the situation that if an element could be otherwise scrolled to from within a container with scroll, that we consider it visible.
I think as a general rule of thumb we should err on the side "thinking an element is visible when its not" vs "thinking an element is hidden when its not".
The text was updated successfully, but these errors were encountered: