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

Support keyboard shortcut hints in overflow menu items. #9426

Closed
brunnerh opened this issue Aug 5, 2021 · 4 comments
Closed

Support keyboard shortcut hints in overflow menu items. #9426

brunnerh opened this issue Aug 5, 2021 · 4 comments
Labels
component: context-menu component: overflow-menu proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡

Comments

@brunnerh
Copy link

brunnerh commented Aug 5, 2021

Summary

For power users it might be helpful to access certain functions like those found in overflow menus via keyboard shortcuts. To help identify what those shortcuts are, it would be nice to show them on the respective menu item.

Justification

Keyboard shortcuts allow more efficient workflows and showing the shortcut on menu items is a de-facto standard way of communicating them.

Desired UX and success metrics

Gesture text should be displayable next to the item. Example from Chrome's menu:

image

The text is commonly less prominent/faded in comparison with the item label.

Issues that come up are usually OS and environment dependencies. It would be nice if those could be handled by the system automatically.

  • Distinction between Ctrl and key display.
  • Is a keyboard even available? (phones, tables, other devices that may or may not have a keyboard connected)
  • Is there enough space to reasonably show the shortcut on the current screen?

The feature is a success if the user can view the item and subsequently perform the associated action via the keyboard.

"Must have" functionality

Show arbitrary shortcut text in designated position/style within overflow menu items.
Worst case scenario any OS/environment attributes have to be handled manually.

Specific timeline issues / requests

Not critical for me at the moment. Tooltips or help pages can be used to show keyboard shortcuts in the meantime.

Available extra resources

The carbon-component-svelte project contains a ContextMenu component which already has a property for shortcut text, but i could not find that in the original Carbon specification. If that is outside the spec, then this probably should be unified in some way.

image

@jnm2377
Copy link
Contributor

jnm2377 commented Aug 9, 2021

@carbon-design-system/design is this feature something we would be interested in supporting?

@aagonzales
Copy link
Member

Seems like it would be possible with the contextual menu as he stated. Should be implementable on the products team side no?

We can maybe look into is the contextual menu allows text on both the left and right in a menu item but that is the only enhancement I can see from a Carbon perspective.

@janhassel
Copy link
Member

Afaik, with the upcoming v11 release, the MenuItem component will also be used for OverflowMenus. Therefore adding shortcut hints shouldn't be a problem soon. Demo: https://67wmd.csb.app/

However, as of right now, the product team would still be responsible for displaying the correct platform-specific shortcut (e.g. vs. ctrl) as well as handling the actual keyboard command. The component only really renders whatever text you pass it.

<MenuItem label="Cut" shortcut="⌘X" />

@jnm2377
Copy link
Contributor

jnm2377 commented Mar 21, 2022

Closing this issue since it was added for v11: https://carbon-react-next.netlify.app/?path=/story/experimental-unstable-menu-contextmenu--context-menu

@jnm2377 jnm2377 closed this as completed Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: context-menu component: overflow-menu proposal: open This request has gone through triaging. We're determining whether we take this on or not. type: enhancement 💡
Projects
Archived in project
Development

No branches or pull requests

5 participants