-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fixed overlay popups not automatically closing #16564
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
Fixed overlay popups not automatically closing #16564
Conversation
We have an entire test class ( |
Indeed! The change looks good, but a matching test (or fix for existing test) would be appreciated, to ensure we don't regress this again. |
Verify popup type whenever we verify that the popup is open
The way in which popups are created changed, so the tests were stuck on default behaviour (tooltip in a popup). I fixed this and added verification that the tooltip host is of the expected type to prevent future issues. |
You can test this PR using the following package version. |
Thanks. While I understand the changes and can see that the overlay host is correctly being used, no tests are actually failing if I revert the actual fix in (Also I don't know why we weren't using the already correctly configured mock |
Excellent point. This secondary issue was caused by overlay tooltips not ever being attached to the visual tree in tests: the layout of the overlay layer is only calculated during rendering, which doesn't happen in headless unit tests. The layer is now manually measured by the overlay test class whenever a tooltip opens, plus we ensure that expected values have been assigned. I wasn't able to get the configured mock windowing platform object to be used, even if I used |
You can test this PR using the following package version. |
That makes perfect sense. Thank you for the fix. |
* Fixed overlay popups not automatically closing * Fix overlay tooltip tests not actually generating overlay tooltips Verify popup type whenever we verify that the popup is open * Fixed overlay tooltips not being attached to the visual tree in tests #Conflicts: # tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
Fixes #16559. The issue was introduced by #15596.
What is the current behavior?
Because overlay popups are hosted within the current window, the code which detects whether the pointer is over the current tooltip produces a false positive.
Breaking changes
None
Obsoletions / Deprecations
None