• Ensures the given target is within the visible scroll area of the specified parent. If the target is not visible, scroll the parent.

    Parameters

    • target: null | Target

      Element, EventTarget, or CSS selector.

    • parent: null | Target

      Element, EventTarget, or selector for scroll parent.

    Returns void

    InvalidElementError if the target or parent specified do not exist.