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

fix: Improve accuracy of determining activeElement in Dropdown #224

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

zolk
Copy link
Contributor

@zolk zolk commented Sep 25, 2020

Fixes #223

If sl-dropdown is used within a shadow root, we need to obtain document.activeElement.shadowRoot?.activeElement rather than just document.activeElement to determine the actively focused element.

Applying this fix to the minimum reproduction resolves the issue.

Screen Recording 2020-09-25 at 18 04 58

@vercel
Copy link

vercel bot commented Sep 25, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shoelace/shoelace/gffdwrz95
✅ Preview: https://shoelace-git-fork-zolk-fix-dropdown-shadow-dom.shoelace.vercel.app

@claviska claviska merged commit 01d484a into shoelace-style:next Sep 28, 2020
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.

Dropdown component used within a shadow root unexpectedly closes when tabbing into slotted elements
2 participants