Skip to content

Commit 076fedb

Browse files
committed
feat: Propagate Popup ZIndex to PopupPanel
1 parent 68b98b8 commit 076fedb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Uno.UI/UI/Xaml/Controls/Popup/Popup.WithPopupRoot.cs

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ partial void OnIsOpenChangedPartialNative(bool oldIsOpen, bool newIsOpen)
9191
XamlRoot = WinUICoreServices.Instance.ContentRootCoordinator.Unsafe_IslandsIncompatible_CoreWindowContentRoot?.XamlRoot;
9292
}
9393
#endif
94+
if (this.IsDependencyPropertySet(Canvas.ZIndexProperty))
95+
{
96+
Canvas.SetZIndex(PopupPanel, Canvas.GetZIndex(this));
97+
}
9498

9599
// It's important for PopupPanel to be visible before the popup is opened so that
96100
// child controls can be IsFocusable, which depends on all ancestors (including PopupPanel)

src/Uno.UI/UI/Xaml/Controls/TextBox/TextBox.skia.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,8 @@ private sealed class TextBoxCommand(Action action) : ICommand
14291429

14301430
private class CaretWithStemAndThumb : Grid
14311431
{
1432+
private const int DefaultZIndex = 10000; // Very high ZIndex to keep carets on top of other popups.
1433+
14321434
// This is equal to the default system accent color on Windows.
14331435
// This is, however, a constant color that doesn't depend on the
14341436
// current system accent color. Changing the accent color does NOT
@@ -1498,6 +1500,8 @@ public void ShowAt(Point p, XamlRoot xamlRoot)
14981500
XamlRoot = xamlRoot
14991501
};
15001502

1503+
Canvas.SetZIndex(_popup, DefaultZIndex);
1504+
15011505
_popup.HorizontalOffset = p.X;
15021506
_popup.VerticalOffset = p.Y;
15031507
if (!_popup.IsOpen)

0 commit comments

Comments
 (0)