|
|
@@ -432,6 +432,26 @@ namespace Avalonia.Controls.UnitTests
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [Fact]
|
|
|
+ public void Should_Reset_Popup_Parent_On_Target_Detached()
|
|
|
+ {
|
|
|
+ using (CreateServicesWithFocus())
|
|
|
+ {
|
|
|
+ var userControl = new UserControl();
|
|
|
+ var window = PreparedWindow(userControl);
|
|
|
+ window.Show();
|
|
|
+
|
|
|
+ var flyout = new TestFlyout();
|
|
|
+ flyout.ShowAt(userControl);
|
|
|
+
|
|
|
+ var popup = Assert.IsType<Popup>(flyout.Popup);
|
|
|
+ Assert.NotNull(popup.Parent);
|
|
|
+
|
|
|
+ window.Content = null;
|
|
|
+ Assert.Null(popup.Parent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[Fact]
|
|
|
public void ContextFlyout_Can_Be_Set_In_Styles()
|
|
|
{
|
|
|
@@ -549,5 +569,10 @@ namespace Avalonia.Controls.UnitTests
|
|
|
new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.LeftButtonPressed),
|
|
|
KeyModifiers.None);
|
|
|
}
|
|
|
+
|
|
|
+ public class TestFlyout : Flyout
|
|
|
+ {
|
|
|
+ public new Popup Popup => base.Popup;
|
|
|
+ }
|
|
|
}
|
|
|
}
|