Roqueform
    Preparing search index...

    Interface ScrollToErrorMixin

    The mixin added to fields by the scrollToErrorPlugin.

    interface ScrollToErrorMixin {
        element: null | Element;
        isInvalid?: boolean;
        ref(element: null | Element): void;
        scrollToError(index?: number, alignToTop?: boolean): null;
        scrollToError(index?: number, options?: ScrollIntoViewOptions): null;
    }
    Index

    Properties

    element: null | Element

    The DOM element associated with the field, or null if there's no associated element.

    isInvalid?: boolean

    true if this field has associated errors.

    Methods

    • Associates the field with the DOM element.

      Parameters

      Returns void

    • Scroll to the element that is referenced by an invalid field. Scrolls the field element's ancestor containers such that the field element is visible to the user.

      The field ref should be populated with an Element reference.

      Parameters

      • Optionalindex: number

        The zero-based index of an invalid field to scroll to. A negative index can be used, indicating an offset from the end of the sequence. scrollToError(-1) scroll to the last invalid field. The visual order of fields is used (by default left-to-right and top-to-bottom).

      • OptionalalignToTop: boolean

        If true, the top of the element will be aligned to the top of the visible area of the scrollable ancestor, otherwise element will be aligned to the bottom of the visible area of the scrollable ancestor.

      Returns null

      The field which is scrolled to, or null if there's no scroll happening.

    • Scroll to the element that is referenced by an invalid field. Scrolls the field element's ancestor containers such that the field element is visible to the user.

      The field ref should be populated with an Element reference.

      Parameters

      • Optionalindex: number

        The zero-based index of an invalid field to scroll to. A negative index can be used, indicating an offset from the end of the sequence. scrollToError(-1) scroll to the last invalid field. The visual order of fields is used (by default left-to-right and top-to-bottom).

      • Optionaloptions: ScrollIntoViewOptions

      Returns null

      The field which is scrolled to, or null if there's no scroll happening.