Skip to main content

getActiveElementDeep

function

Descends from `root.activeElement` through nested open ShadowRoots to the deepest focused element. `document.activeElement` only reports the outermost shadow host; this walks into the shadow trees via `ShadowRoot.activeElement` to find the element that actually has focus.

function getActiveElementDeep(root: Document | ShadowRoot): Element | null

Import

import { getActiveElementDeep } from '@modular/sdk/editor';

Notes

returns
The deepest active element, or null.