Skip to content
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

option to disable scroll per command (Auto scroll on click/trigger can break virtual grids) #4356

Closed
lukeapage opened this issue May 31, 2019 · 6 comments · Fixed by #8837
Closed

Comments

@lukeapage
Copy link
Contributor

Current behavior:

Cypress click will scroll an element inside a virtual grid to the top.

However in between the scroll and triggering the click, the virtual grid can hear the scroll, then change which dom row corresponds to which data row (usually in virtual grids, in order that mobile scrolling works you have a window of real dom nodes and upon a scroll you move the data and then the y position of the rows so that the user can continue seamlessly scrolling).

This means that day the grid is rows 1-7 and you get 3.. the trigger is executed on the same dom element that was fetched, but because of the scroll it has become a row containing the data in 5.

Because of race conditions, this usually ends up being intermittent depending on if cypress or the scroll listener wins.

Desired behavior:

I’d love to be able to disable scroll per command or else entirely so it has to be explicit (better I think for an spa)

@bkucera this is the scenario I mentioned on the Pr

@lukeapage
Copy link
Contributor Author

Oh and workaround is to force every click - for some reason that doesn’t try and scroll. But I’d rather have the visibility checks.

@jennifer-shehane
Copy link
Member

Can you try to provide a small reproducible example of this please?

@yuki-93
Copy link

yuki-93 commented Jun 20, 2019

I have the same problem with comboboxes in ExtJS, which are not plain elements. They are kind of overlays which close again when scrolling. force:true doesn't seem to work for me.

@lukeapage
Copy link
Contributor Author

Afaik Force true disables scrolling, so if that doesn’t work, something else is probably going on.

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Oct 14, 2020
@kuceb kuceb changed the title Auto scroll on click/trigger can break virtual grids option to disable scroll per command (Auto scroll on click/trigger can break virtual grids) Nov 30, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Nov 30, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 30, 2020

The code for this is done in cypress-io/cypress#8837, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 7, 2020

Released in 6.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants