Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiContextMenuPanelDescriptor] Allow specifying initialFocusedItemIndex for panel #4216

Closed
flash1293 opened this issue Nov 3, 2020 · 0 comments · Fixed by #4223
Closed
Assignees

Comments

@flash1293
Copy link
Contributor

If menu panels are constructed manually by the consumer, the first item to focus can be set by using initialFocusedItemIndex. However if using the EuiContextMenuPanelDescriptor approach (passing panels into an EuiContextMenu element), it's automatically set to 0 if keyboard navigation is used which might not always be the desired behavior (e.g. elastic/kibana#81058)

I can imagine extending EuiContextMenuPanelDescriptor by initialFocusedItemIndex and using that in favor of 0 if set.

This is where the new prop would be hooked in
https://github.com/elastic/eui/blob/master/src/components/context_menu/context_menu.tsx#L388

@thompsongl thompsongl changed the title Allow specifying initialFocusedItemIndex for panel created by EuiContextMenuPanelDescriptor [EuiContextMenuPanelDescriptor] Allow specifying initialFocusedItemIndex for panel Nov 3, 2020
@thompsongl thompsongl self-assigned this Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants