Skip to content

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

Description

@majornista

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;
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions