position sticky and flex, cypress scrolls to the end of page to access element
See original GitHub issue- Operating System: macOS High Sierra 10.13.3
- Cypress Version: 2.1.0
- Browser Version: Chrome 59
Is this a Feature or Bug?
Bug
Current behavior:
When using position: sticky
and display: flex
combination cypress gets mad when trying to access element inside sticky element:
It scrolls to the end of the page before performing any operations on the element while it is not required as the element is visible and accessible.
Desired behavior:
Should access elements without scrolling
How to reproduce:
https://github.com/RomanGotsiy/cypress-test-tiny
Just run npm run cypress:open
and select the only available suite.
There are three tests there:
type
into the inputclick
on the link- both but with
{force: true}
which works as expected
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:6 (5 by maintainers)
Top Results From Across the Web
CSS Position Sticky Tutorial With Examples[Complete Guide]
The CSS position sticky element toggles between these two positions depending on the scroll of the page. So, a CSS position sticky element...
Read more >Interacting with Elements - Cypress Documentation
Scroll the page if still covered by an element with fixed position. Fire the event at the desired coordinates.
Read more >sticky element do not 'stick' to viewport's top on cypress browser
When run on cypress browser, the element being scrolled out of the view port. my-component.style.ts:` :host { position: -webkit-sticky; ...
Read more >How To Make Elements Stick with CSS position: sticky
A quick guide on how to use the position: sticky property in CSS to make elements become sticky when the page is scrolled...
Read more >Scroll an element into the center of the viewport - Hidde's blog
This isn't always ideal, sometimes you may have a sticky header, so scrollling an element to the top of the document would not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in
3.0.2
.I have a similar issue. I’m using Kendo Grid and the dropdowns are generated and then fixed to the element you clicked.
Cypress scrolls down to the bottom of my page, even though the area to be typed in is visible at the top.
A SECONDARY issue is that when coupled with .type() this SOMETIMES makes the dropdown vanish, making every test thereafter fail. This behavior is inconsistent and frustrating, because sometimes the scrolling will decide to close the dropdown and sometimes not.
This makes testing custom dropdowns in Kendo Grid almost impossible.