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
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.
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?
Current behavior
When code under test calls
HTMLElement.focus()
with thepreventScroll
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 thepreventScroll
option is set to true.Test code to reproduce
https://github.com/diminutivesloop/cypress-test-tiny/blob/breaks-preventscroll/cypress/integration/spec.js
Versions
Cypress 6.6.0
Chrome 88.0.4324.190
Windows 10
The text was updated successfully, but these errors were encountered: