-
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
onFocus event incorrectly fires on a hidden element starting on v3.3.2 #4898
Comments
Thanks for giving us so much direction on tracking this down and also providing a reproducible example! It helps a lot. To reproduce it('focus should not fire on input.d647', () => {
cy.visit('https://www.unibet.com/betting/sports/home')
}) I was able to narrow this down to version 3.3.2 of Cypress, although I did not specifically narrow down the issue to this commit 7efd9d8 So, upon adding a listener to the When running in Cypress I see the The notes on this method say
So, what's unique about this input? Maybe the fact that it has <div style='display: none'>
<div>
<input>
<div>
</div> It looks like we do a pretty simple check on if an element is focusable here: 7efd9d8#diff-22a86df1bb6a99b0a980cb1cf50fef23R28 Just from a brief reading of the spec, it looks like elements that are Partial Focusable definition
Being rendered definition
I think the hidden definition includes elements with |
Awesome! thanks for the quick response and PR already in place :) |
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. |
Released in |
Current behavior:
Since the merge of #2982 in v3.3.2, the hidden search bar on the site https://www.unibet.com/betting/sports/home is always opened on cy.visit() of the page

This does not happen when the site is visited manually without Cypress
Desired behavior:
The search bar remains hidden, same as if the page is visited manually.
Steps to reproduce: (app code and test code)
Versions
Issue started with Cypress 3.3.2
The text was updated successfully, but these errors were encountered: