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

[Feature]: Allow ShortcutKeyDescription to be Set on CoreWebView2ContextMenuItem #4727

Open
NeonBits opened this issue Aug 5, 2024 · 4 comments
Assignees
Labels
feature request feature request

Comments

@NeonBits
Copy link

NeonBits commented Aug 5, 2024

Describe the feature/enhancement you need

I'm currently working on a WPF application where I need to override the context menu.
This has been fairly straightforward so far, but I cannot work out how to specify a keyboard shortcut to be displayed on the menu item.

I would like the shortcuts to appear the same as the default menu:
image

The CoreWebView2ContextMenuItem.ShortcutKeyDescription property is read only.
The CoreWebView2ContextMenuItem.Label property documentation suggests that it "Will contain an ampersand for characters to be used as keyboard accelerator."

I've tried eg. "MyCommandLabel&Ctrl+H" but the shortcut is just incorporated into the label.

Am I missing something? Is it done this way due to localization?
It would be much easier to be able to override the property value with Set.

The scenario/use case where you would use this feature

It's important for accessibility considerations and for "power users" to be able to specify the keyboard capabilities of the given commands,

How important is this request to you?

Impactful. My app's user experience would be significantly compromised without it.

Suggested implementation

No response

What does your app do? Is there a pending deadline for this request?

No response

@NeonBits NeonBits added the feature request feature request label Aug 5, 2024
@ajtruckle
Copy link

ajtruckle commented Aug 5, 2024

I asked for this myself. They won't do it sadly. Their justification is that you can use a native menu instead of the WV2 menu.

Whilst a native menu will render shortcuts correctly, the thing is that I want to use a WV2 menu. And, I can't for the life of me understand why the API does not let us set the hotkey description on the right.

@ajtruckle
Copy link

#2373

@NeonBits
Copy link
Author

NeonBits commented Aug 6, 2024

@ajtruckle Thanks for your response, that's disappointing to hear.
Maybe they'll reconsider as more people run into the problem.

I guess I'll spend today deleting my code and creating a native menu instead...

@ajtruckle
Copy link

@NeonBits I agree, if more users express a desire for this to be available for the WV2 API ... 😊👍 Happy coding! 🖖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request
Projects
None yet
Development

No branches or pull requests

3 participants