-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Disabled menu items shouldn't close the dropdown when clicked #6412
Comments
If no-one is working on this, I'd like to take this on. A good reason for a deep dive into the event system. |
@simonhaines nobody from core team has started this task yet, so it's free. |
@maxkatz6 the first condition is where I am focusing effort, but there are some subtleties, as always. Currently the popup closes when disabled elements are clicked, but also separators, and clicks in the client area of the popup outside enabled menu items. The simplest thing I have done that works is change the first condition to: if (item.IsTopLevel && e.Source is not Border)
{
CloseMenu(item);
} This is a quick test to see if the pointer press event is bubbled from the |
Pointer clicks on disabled and non-interactive items in sub-menus are bubbled up to the sub-menu's parent, causing the sub-menu popup to be closed when it is expected to remain open. This scenario is identified and filtered out by searching for a popup in the logical tree between the source and the handler. Fixes AvaloniaUI#6412.
Pointer clicks on disabled and non-interactive items in sub-menus are bubbled up to the sub-menu's parent, causing the sub-menu popup to be closed when it is expected to remain open. This scenario is identified and filtered out by searching for a popup in the logical tree between the source and the handler. Fixes AvaloniaUI#6412.
Right now, if you have a MenuItem with IsEnabled="false", it's grayed out as expected. But when you click on it, the dropdown menu still closes. This doesn't match other UIs (like with Chrome's context menu or Visual Studio's menu, for example).
edit: it only happens with dropdowns from a top level menu item and not the flyouts for subitems
The text was updated successfully, but these errors were encountered: