Skip to content

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

Open
@majornista

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

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