getActiveElement
functionReturns the focused element within the same Document or ShadowRoot as `node`, using the standard `DocumentOrShadowRoot.activeElement`. Unlike `document.activeElement` — which is retargeted to the outermost shadow host when focus is inside a shadow tree — this returns the focused element within `node`'s own tree (e.g. the editor's contentEditable when it lives inside a shadow root).
Import
import { getActiveElement } from '@modular/sdk/editor';Notes
- returns
- The active element, or null.