maui icon indicating copy to clipboard operation
maui copied to clipboard

Disabling a MenuBarItem doesn't stop its sub-items from appearing when clicked

Open andyjohnson0 opened this issue 2 years ago • 1 comments

Description

If a top-level MenuBarItem, with sub-items, has its IsEnabled property set to false then the sub-items still appear when the menu bar item is clicked. This is contrary to expectation. Verified on Windows only.

Steps to Reproduce

  1. Create a File->New .NET Maui app

  2. In MainPage.xaml add a top-level menu with a single subitem by adding the following after the start of the <ContentPage> element and before the start of its nested <ScrollView> element:

    <ContentPage.MenuBarItems>
        <MenuBarItem Text="File">
            <MenuFlyoutItem Text="Exit" />
        </MenuBarItem>
    </ContentPage.MenuBarItems>
  1. In MainPage.xaml.cs add an OnAppearing() method to the MainPage class and disable the top-level MenuBarItem :
	protected override void OnAppearing()
	{
		base.OnAppearing();
		MenuBarItems[0].IsEnabled = false;
	}
  1. Run the app and click the File menu. The dropdown still appears.

Link to public reproduction project repository

https://github.com/andyjohnson0/MauiMenuItemEnableIssue

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10.0.17763.0

Did you find any workaround?

No

Relevant log output

No response

andyjohnson0 avatar Nov 24 '22 08:11 andyjohnson0

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.

ghost avatar Nov 24 '22 19:11 ghost