-
Notifications
You must be signed in to change notification settings - Fork 706
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
CommandBarFlyout: Submenu persists when CommandBar closes #1792
Comments
@llongley can you please investigate ? |
@llongley Are you currently looking into this? Or would you be fine with me looking into this? @ranjeshj FYI. Also looking at the code for the page, it seems that the CommandBarFlyout is not the owner of the popup, but rather the AppBarButton is. Should we add some code in the closed event to iterate over all the primary and secondary commands, and check if those are buttons, and hide the flyout if they have one? |
@chingucoding go for it. Is this an issue with the control or the app code ? I would not have expected to write app code to close the submenu items. |
I think it's a grey area here. On the one hand, the CommandBarFlyout is not really aware of the flyout as the secondary commands open it, which in theory don't have to be a button, they could be anything that opens some form of flyout through the Button.Flyout property. In that case we literally have no idea how to close existing flyouts without walking the visual tree. In the case of Button.Flyout, we can iterate over all the commands, check if they are a button, and if they are and they have a flyout, close the flyouts. |
Hey, thanks for offering to take this on! One interesting thing I should note is that if you uncheck "Long animations disabled" in the test app's main page, the issue stops reproducing, at least for me - in that case, the MenuFlyout closes when the CommandBarFlyout closes. So there may be an issue where we're assuming that an animation will complete somewhere before we close the child flyout. We should definitely in general be closing child flyouts when the parent closes. |
That's a very good observation. As it turns out, when we disable long animations, this code does not get called: microsoft-ui-xaml/dev/CommandBarFlyout/CommandBarFlyout.cpp Lines 158 to 165 in 2ec9b1c
Adding an |
Describe the bug
When closing a CommandBarFlyout while a submenu is open that belongs the the CommandBarFlyout, the SubMenu is still visible.
Steps to reproduce the bug
Steps to reproduce the behavior:
Expected behavior
The submenu disappears with the CommandBarFlyout.
Screenshots
Version Info
NuGet package version:
Latest commit on master.
Additional context
The text was updated successfully, but these errors were encountered: