Interface FindParentOptions
excludeClasses?: Iterable<string>;
excludeIds?: Iterable<string>;
excludeSelector?: string;
includeClasses?: Iterable<string>;
includeIds?: Iterable<string>;
maxDepth?: number;
predicate?: (el: Element) => boolean;
selector?: string;
stackingContext?: boolean;
stopAt?: Element;
}
Hierarchy
- ElementMatchesOptions
- FindParentOptions (View Summary)
Properties
OptionalexcludeClasses
Iterable list of CSS classes which disqualify an element.
OptionalexcludeIds
Iterable list of IDs which disqualify an element.
OptionalexcludeSelector
CSS selector which disqualifies an element if matched.
OptionalincludeClasses
Iterable list of CSS classes an element must contain to be accepted.
OptionalincludeIds
Iterable list of IDs an element must have to be accepted.
OptionalmaxDepth
Positive integer defining maximum number of parentElement hops allowed.
Optionalpredicate
Custom predicate; must return true for an element to be accepted.
Optionalselector
CSS selector an ancestor must match to be accepted.
OptionalstackingContext
When true, traverse parent elements until the stacking context element is found. The stacking context element will be evaluated against any filter criteria such as inclusion / exclusion rules. If it passes the filter then it is returned otherwise the next stacking context element is evaluated.
This option overrides stopAt and maxDepth options.
OptionalstopAt
Stops traversal when this element is reached.
The element itself will still be evaluated against any filter criteria such as inclusion / exclusion rules. If it
passes the filter then it is returned. If it does not pass then null is returned.
Options for findParentElement. The most common options are use of FindParentOptions.stackingContext and / or the exclusion CSS class / ID properties such as ElementMatchesOptions.excludeClasses.