Skip to main content

@microsoft/fast-foundation > composedContains

composedContains() function

Determines if the reference element contains the test element in a "composed" DOM tree that ignores shadow DOM boundaries.

Returns true of the test element is a descendent of the reference, or exist in a shadow DOM that is a logical descendent of the reference. Otherwise returns false.

Signature:
export declare function composedContains(reference: HTMLElement, test: HTMLElement): boolean;

Parameters

ParameterTypeDescription
referenceHTMLElementThe element to test for containment against.
testHTMLElementThe element being tested for containment.
Returns:

boolean