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

breaks HTMLElement.focus() preventScroll option #15294

diminutivesloop opened this issue Mar 2, 2021 · 3 comments

breaks HTMLElement.focus() preventScroll option #15294

diminutivesloop opened this issue Mar 2, 2021 · 3 comments


Copy link

Current behavior

When code under test calls HTMLElement.focus() with the preventScroll option set to true, the page under test scrolls the focused element into view.

Desired behavior

HTMLElement.focus() should behave the same whether or not it's called in the context of a Cypress test and preserve the current scroll position when the preventScroll option is set to true.

Test code to reproduce


Cypress 6.6.0
Chrome 88.0.4324.190
Windows 10

Copy link

I have a similar issue regarding custom elements. If I have an input inside of a custom element and redirect focus to this input (mostly for form support), the user can no longer physically click on the input. Is there a reason to prevent calling the native focus method if available?

Copy link

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

Copy link

cypress-bot bot commented Jul 7, 2021

Released in 7.7.0.

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

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jul 7, 2021
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants