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

[Bug] Menu missing accelerators #5211

Closed
Tracked by #14021 ...
davidortinau opened this issue Mar 10, 2022 · 10 comments · Fixed by #14740
Closed
Tracked by #14021 ...

[Bug] Menu missing accelerators #5211

davidortinau opened this issue Mar 10, 2022 · 10 comments · Fixed by #14740
Assignees
Labels
fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)

Comments

@davidortinau
Copy link
Contributor

Description

I can create a menu and use the accelerator api, however it doesn't do anything. I should be able to use this or similar to add keyboard shortcuts to menu items.

void InitMenu()
		{
			var fileMenu = new MenuBarItem { Text = "File" };
			var exitItem = new MenuFlyoutItem
			{
				Text = "Exit",
				Command = new Command((obj) =>
				{
					Application.Current.Quit();
				})
			};
			MenuItem.SetAccelerator(exitItem, Accelerator.FromString("cmd+q"));
			fileMenu.Add(exitItem);

			var locationMenu = new MenuBarItem { Text = "Location" };
			var changeItem = new MenuFlyoutItem
			{
				Text = "Change",
				Command = new Command((obj) =>
				{
					Navigation.PushAsync(new ButtonPage());
				})
			};
			locationMenu.Add(changeItem);

			var refreshItem = new MenuFlyoutItem
			{
				Text = "Refresh"
			};
			MenuItem.SetAccelerator(refreshItem, Accelerator.FromString("cmd+r"));
			locationMenu.Add(refreshItem);

			this.MenuBarItems.Add(fileMenu);
			this.MenuBarItems.Add(locationMenu);
		}

Steps to Reproduce

Add the code above to a ContentPage, run it. Note no compiler error, and no keyboard support.

Version with bug

Release Candidate 1

Last version that worked well

Unknown/Other

Affected platforms

Windows, macOS

Affected platform versions

win11

Did you find any workaround?

No response

Relevant log output

No response

@davidortinau davidortinau added t/bug Something isn't working s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Mar 10, 2022
@jfversluis jfversluis added legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Mar 11, 2022
@shimingsg shimingsg added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 14, 2022
@shimingsg
Copy link

verified repro with vs 17.2.0 Preview 3.0 [32313.56.main] on windows

@Redth Redth added this to the 6.0.300 milestone Mar 21, 2022
@egvijayanand
Copy link
Contributor

Pressing the Alt key or its equivalent in macOS should visually indicate the Accelerator Key mapped to that menu item, like Alt+F for the File menu.

Generally, we would achieve this like &File (Placing an ampersand sign in front of the char that would be the menu item accelerator key).

@davidortinau davidortinau added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Apr 29, 2022
@Redth Redth added p/2 Work that is important, but is currently not scheduled for release and removed p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint labels May 3, 2022
@samhouts samhouts modified the milestones: 6.0.300, 6.0.300-servicing May 7, 2022
@PureWeen PureWeen removed their assignment Aug 3, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@egvijayanand
Copy link
Contributor

Hello Team,

Without accelerators for the menu items, how can the keyboard interaction happen? It's a must-have feature for desktops, both Windows and macOS. It's already a supported feature on Xamarin.Forms.

Regards,
Vijay Anand E G

@molesmoke
Copy link
Contributor

@Redth Could you explain why this is only considered p2? As @egvijayanand pointed out, this is pretty much a blocker for writing a desktop app with MAUI. It seems surprising that this would get moved to the backlog.

@Redth
Copy link
Member

Redth commented Aug 31, 2022

We have a lot of different features and bugs that are different levels of importance to many different customers.

We are doing our best to prioritize the time and resources we have.

One of the ways we try and gauge the level of impact an issue has is activity within it (eg: comments and reactions).

We will continue to reassess which issues should be prioritized as we plan out our work.

@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Dec 14, 2022
@samhouts samhouts added p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint and removed p/2 Work that is important, but is currently not scheduled for release labels Dec 17, 2022
@MartyIX
Copy link
Contributor

MartyIX commented Jan 24, 2023

Does anyone know about a workaround for this?

@samhouts samhouts modified the milestones: Backlog, .NET 8 Planning Jan 26, 2023
@samhouts samhouts removed the s/verified Verified / Reproducible Issue ready for Engineering Triage label Apr 5, 2023
@samhouts samhouts modified the milestones: .NET 8 Planning, .NET 8 Apr 6, 2023
@jinxinjuan jinxinjuan added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage labels Apr 19, 2023
@jinxinjuan
Copy link

Verified this issue with Visual Studio Enterprise 17.6.0 Preview 3.0. Repro on windows machine with sample project.
MauiApp19.zip

@MartyIX
Copy link
Contributor

MartyIX commented Apr 19, 2023

(As https://github.com/dotnet/maui/issues/new?assignees=&labels=t%2Fbug&template=bug-report.yml mentions, zips are not allowed. Your sample project should be a github repo.)

@jeremy-visionaid
Copy link
Contributor

jeremy-visionaid commented May 11, 2023

Hoping to see some progress on this one! Or at least a very least workaround...
It's a blocker for accessibility, since blind/visually impaired users are going to want to access menus with keyboard accelerators.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 2, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! label Aug 8, 2023
@Eilon Eilon added the t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Projects
None yet
Development

Successfully merging a pull request may close this issue.