Interface FocusControls

Controls that move focus inside a focus scope.

interface FocusControls {
    focusDown(options?: UnorderedFocusOptions): boolean;
    focusFirst(options?: OrderedFocusOptions): boolean;
    focusLast(options?: OrderedFocusOptions): boolean;
    focusLeft(options?: UnorderedFocusOptions): boolean;
    focusNext(options?: OrderedFocusOptions): boolean;
    focusPrevious(options?: OrderedFocusOptions): boolean;
    focusRight(options?: UnorderedFocusOptions): boolean;
    focusUp(options?: UnorderedFocusOptions): boolean;
    hasFocus(): boolean;
    isActive(): boolean;
}

Methods

  • If focus scope contains the currently focused element, then moves focus to the closest focusable element below the currently focused element.

    Parameters

    Returns boolean

    true if an element was focused.

  • Focuses the first focusable element inside a focus scope.

    Parameters

    Returns boolean

    true if an element was focused.

  • Focuses the last focusable element inside a focus scope.

    Parameters

    Returns boolean

    true if an element was focused.

  • If focus scope contains the currently focused element, then moves focus to the closest focusable element at left side from the currently focused element.

    Parameters

    Returns boolean

    true if an element was focused.

  • If focus scope contains the currently focused element, then the next element in Tab order after it receives focus.

    Parameters

    Returns boolean

    true if an element was focused.

  • If focus scope contains the currently focused element, then the previous element in Tab order before it receives focus.

    Parameters

    Returns boolean

    true if an element was focused.

  • If focus scope contains the currently focused element, then moves focus to the closest focusable element at right side from the currently focused element.

    Parameters

    Returns boolean

    true if an element was focused.

  • If focus scope contains the currently focused element, then moves focus to the closest focusable element above the currently focused element.

    Parameters

    Returns boolean

    true if an element was focused.

  • Returns true if the currently focused element is contained inside the scope container.

    Returns boolean

  • Returns true if a focus scope contains focused element, or if a focus scope is a part of an active focus trap.

    Returns boolean