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

chore: comparisons to document.activeElement consider shadowRoot #6899

Merged

Conversation

scomea
Copy link
Collaborator

@scomea scomea commented Jan 25, 2024

📖 Description

In a number of places we check if document.activeElement matches some other element, but these checks don't always account for the possibility that the component is in a shadow root. This change adds a utility function to do that and updates a number of components to compare to the result of that function instead of document.activeElement.

🎫 Issues

ad-hoc

📑 Test Plan

Current tests work.

✅ Checklist

General

  • I have included a change request file using $ yarn change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

@scomea scomea mentioned this pull request Jan 25, 2024
9 tasks
@KingOfTac
Copy link
Collaborator

lgtm.

@scomea scomea marked this pull request as ready for review January 25, 2024 01:13
@chrisdholt chrisdholt merged commit df2ca50 into microsoft:master Feb 5, 2024
5 checks passed
janechu pushed a commit that referenced this pull request Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants