Skip to content

Prop to disable active index change on up / down keys #635

@learningdesignlabs

Description

@learningdesignlabs

Perusing the existing issues, I can see that active index is meant to be internal.

However, I believe there's a use case for being able to set it as a prop: when the options are sequential (as in a list of available times to choose from), and if we want behavior similar to how Google calendar events work, where adjacent options should still be displayed, we'd want to have the current option highlighted and selectable from pressing Enter:

Sample select behavior for sequential choices

Additionally, if we want the option of pressing up/down and moving from our current time to a new one, at the moment, even a custom menu and menu item render won't allow this behavior, because the current UP / DOWN behavior is part of the source code and always starts from the very first item of the list.

As I understand, if I could pass a function that specifies the active index, then I could base the active index off of the current selected value. Or, perhaps there is a way to expose the "_handleActiveIndexChange" function?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions