-
-
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
Fix Button.Flyout
not toggling
#8448
Conversation
Expose OverlayDismissEventPassThrough on FlyoutBase
@pr8x I'll close my PR and we'll use this one as it also contains fixes. What I assume should happen is that if cc: @maxkatz6 |
@grokys it's a direct property, so does IsSet work there properly? |
Ah yeah
|
I wonder if we could just explicitly set the |
@pr8x yes, it should be better |
Is this what UWP does? |
No idea. Couldn't find the source code for |
I think it should be easy enough to determine by adding a flyout to a button and seeing if it behaves differently to flyouts on other controls? |
Tagging @amwx who did the implementation for |
You can test this PR using the following package version. |
Taken a look at UWP, and it looks like there, no passthrough is being set. Here's my test code:
You can see that hovering over the button with the flyout open does not set |
From the related issue:
This actually sounds like the root of the problem. Even when |
I think this is due to |
You can test this PR using the following package version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Current changes in Button.cs look good.
- Feature wise, we need Flyout.OverlayInputPassThroughElement anyway, so it should be added. As it was in Add OverlayInputPassThroughElement to FlyoutBase. #8446.
- Let's not set Flyout.OverlayInputPassThroughElement by default (keep it null). But set OverlayDismissEventPassThroughProperty to false. With this combination I can't reproduce original issue.
@grokys do you remember why OverlayDismissEventPassThroughProperty was set to true on the ContextMenu (and later copied to the FlyoutBase)?
I am actually not sure if we even need Flyout.OverlayDismissEventPassThroughProperty property, we can just disable it on the inner popup without giving customization. Flyout.OverlayInputPassThroughElement should be enough. Unless @grokys is against it.
Actually when we disable |
True. I just think it makes sense to toggle flyout OnClick instead of just opening. |
For Context Menu I can imagine the user wants to open it at a different position once clicked on a different position of the same control. Like when you have a collection of images. Have to double check if that's the same behavior in normal Windows or just in a particular App I have in mind. |
@timunie oh, it's actually a good point |
Okay, So I double-checked this and it's not consistent over the programs I use: Close ContextMenu on second right click:
Open ContextMenu at another position on second right click:
List could be extended if needed. |
Yeah, seems like a platform-specific thing. It's probably something we could change per-platform once we have a platform settings API, but for the moment we should probably just stick with the existing behavior for |
To make a context menu open again at different mouse position we only need |
@maxkatz6 Fixed it. |
…into fix-button-flyout
You can test this PR using the following package version. |
You can test this PR using the following package version. |
Button.Flyout
not toggling correctly (see Button.Flyout should toggle on/off #8379) by manually settingOverlayInputPassThroughElement
toplacementTarget
insideFlyoutBase
(as suggested by @maxkatz6). Not sure if this can have side effects for other code using flyouts.OverlayDismissEventPassThrough
onFlyoutBase
to allow for customizing event pass-through behavior.Fixes #8379