• This function is a helper for keyboard navigation through dropdowns.

    Parameters

    • index: number

      The index of the element you're on

    • position: string

      The orientation of the dropdown

    • collection: any[]

      Array of refs to the items in the dropdown

    Returns number