-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Scrolling strategy make element cannot click #2302
Comments
I think this is related to #871 , is there any updates on that issue? |
https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/actionability.coffee#L230 |
Yes, you can disable our checks on whether the element is 'clickable' by just passing |
@jennifer-shehane |
Cypress is supposed to automatically scroll the element into view - but due to This looks like one of these situations. We've internally decided that our algorithms should always scroll (to be deterministic) but we've been reconsidering this since scrolling is a mutation and there have been side effects that cause problems like these. And/or in addition to, we've been considering just allowing you to pass a |
@brian-mann |
I'm having the same issue. The problem is that the "changeable scrolling strategy" feature (#871) was discussed about a year ago and nothing has happened so far. Please don't close this. |
This should be fixed when we change our default scroll strategy to center the element in the viewport, part of |
Also having problems with overscrolling elements. Check the video please: #871 (comment) |
Reproducible example:
it('can click the 3 behind masked el', () => {
cy.visit('index.html')
cy.contains('3').click()
})
<html>
<style>
.item {
padding: 15px;
background: lightsteelblue;
}
</style>
<body>
<div class="container" style="width: 400px;">
<div class="mask" style="padding: 15px; background: lightpink; z-index: 2; position: relative;">mask</div>
<div class="long-list" style=" height: 300px; overflow: auto; margin-top: -48px;">
<div class="item">placeholder</div>
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
<div class="item">10</div>
</div>
</div>
</body>
</html> |
it seems like the problem is that cypress call "scrollIntoView" which hides the element when the element has a parent element with scroll. element.scrollIntoView({block: "end"}); should fix that. |
closing this as a duplicate of #871, which has an associated PR open |
In Cypress 6.1.0, there’s a new If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix. |
Current behavior:
As the guide documented:
This cause some element cannot be clicked and the "nudge" seems not working.
I've produced a smallest example for the bug on codepen:
https://codepen.io/yuyz0112/pen/jpeZvZ
Cypress code:
cy.contains('3').click();
After execute click command, the item contains '3' scrolled to the top and was covered by the mask element.
Desired behavior:
I'm not sure whether this situation should be covered by the scrolling strategy, but I still expect a method to test this without change my code.
Steps to reproduce:
Versions
v3.0.3
The text was updated successfully, but these errors were encountered: