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

Runtime error when tabbing elements where shadowDom is a document fragment rather than an element #1039

Open
majornista opened this issue Feb 12, 2024 · 0 comments

Comments

@majornista
Copy link

el.activeElement in the following method will be null if el is a document fragment rather than an element, which throws a runtime error:

function getActiveElement(el = document) {
return el.activeElement.shadowRoot
? getActiveElement(el.activeElement.shadowRoot)
: el.activeElement;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants