-
Notifications
You must be signed in to change notification settings - Fork 841
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] Add initialFocusedItemIndex
support
#4223
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change works for me. One very small change requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉 (needs changelog)
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
jenkins test this
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
Wow, that was quick - thanks @thompsongl for picking it up! I know I didn't mention this explicitly in the issue, but it seems like with this approach it's not possible to set |
@flash1293 Ok, I think I fully understand your use case now. |
@thompsongl Sounds great to me |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks good
Preview documentation changes for this PR: https://eui.elastic.co/pr_4223/ |
…elastic#4223) * respect initialFocusedItemIndex in EuiContextMenuPanelDescriptor * add initialFocusedItemIndex example * nullish coalescing operator * CL * -1 focuses the panel
Summary
Closes #4216 by adding support for
initialFocusedItemIndex
when using theEuiContextMenuPanelDescriptor
approach.Rather than reserve setting focus to situations of keyboard navigation,
EuiContextMenu
will now respect setting focus when specified as well as use the value for initial focus in situations of keyboard navigation.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Added or updated jest tests