Function findMatchingAncestor

  • Recursively search for an ancestor of the starting element that passes the given callback.

    Parameters

    • start: Element
    • testParent: ((parent: Element) => boolean)
        • (parent): boolean
        • Parameters

          • parent: Element

          Returns boolean

    Returns Element | undefined