-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix: make isFocusedOrInFocused check shadow roots #26207
fix: make isFocusedOrInFocused check shadow roots #26207
Conversation
bc8e4a4
to
8d7622d
Compare
1 failed and 30 flaky tests on run #44937 ↗︎
Details:
src/debug/DebugSpec.cy.tsx • 1 failed test • app-ct
create-from-component.cy.ts • 1 flaky test • app-e2e
specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e
cypress-in-cypress-component.cy.ts • 1 flaky test • app-e2e
cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e
commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox
The first 5 flaky specs are shown, see all 18 specs in Cypress Cloud. This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
@lmiller1990 I see that there are several errors from the checks running. Are they blocking review? If so, I don't see how they're caused by my code change. What do I need to do to resolve them? |
Oh, I clicked the "re-request review" button and it removed @lmiller1990 as a reviewer -- not sure why that happened; I'll make sure not to click that button again 😅 |
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Because shadowRoots don't have a getSelection function
42de3a9
to
27bfdc9
Compare
Is there any chance of this getting merged before the release planned tomorrow? |
Two approvals, CI green, let's ship it! Thanks for the contribution 🎉 |
Additional details
Currently, checking for focus doesn't look inside of shadow roots. This causes issues such as the
type
command always firing theclick
even if the element has focus.This PR changes the behavior of
isFocusedOrInFocused
to check if the element passed in is anactiveElement
inside of a shadow root.Steps to test
Clone https://github.com/kgroat/cypress-type-repro and run the component test. Before these changes, it fails, but after it passes.
How has the user experience changed?
N/A
PR Tasks
cypress-documentation
?type definitions
?