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

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

Closed
andyjohnson0 opened this issue Nov 24, 2022 · 1 comment · Fixed by #11695
Closed
Assignees
Labels
area-controls-menubar Desktop MenuBarItems fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@andyjohnson0
Copy link

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 andyjohnson0 added the t/bug Something isn't working label Nov 24, 2022
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Nov 24, 2022
@ghost
Copy link

ghost commented Nov 24, 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.

@jsuarezruiz jsuarezruiz self-assigned this Nov 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2022
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Feb 22, 2023
@samhouts samhouts modified the milestones: Backlog, 8.0-preview1 Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-menubar Desktop MenuBarItems fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants