@microsoft/fast-element > composedParent
composedParent() function
Retrieves the "composed parent" element of a node, ignoring DOM tree boundaries. When the parent of a node is a shadow-root, it will return the host element of the shadow root. Otherwise it will return the parent node or null if no parent node exists.
Signature:
export declare function composedParent<T extends HTMLElement>(element: T): HTMLElement | null;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
element |
T |
The element for which to retrieve the composed parent |
Returns:
HTMLElement | null