From 8ecb791546954c6266dcf4ea33de3387e892389d Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Fri, 7 Feb 2025 17:05:26 +0100 Subject: [PATCH 1/3] Move down column action popup to prevent z-index issues --- src/Core/Components/DataGrid/FluentDataGrid.razor.css | 2 +- src/Core/Components/DataGrid/FluentDataGridCell.razor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Components/DataGrid/FluentDataGrid.razor.css b/src/Core/Components/DataGrid/FluentDataGrid.razor.css index d3f541409d..58a06b2938 100644 --- a/src/Core/Components/DataGrid/FluentDataGrid.razor.css +++ b/src/Core/Components/DataGrid/FluentDataGrid.razor.css @@ -27,7 +27,7 @@ .col-options, .col-resize { position: absolute; min-width: 250px; - top: 2.4rem; + top: 2.7rem; background: var(--neutral-layer-2); border: 1px solid var(--neutral-layer-3); border-radius: 0.3rem; diff --git a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs index 7a7b9edfce..3bec9eb116 100644 --- a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs +++ b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs @@ -80,7 +80,7 @@ public partial class FluentDataGridCell : FluentComponentBase .AddStyle("height", "100%", Grid.MultiLine) .AddStyle("min-height", "44px", Owner.RowType != DataGridRowType.Default) .AddStyle("display", "flex", ShouldHaveDisplayFlex()) - .AddStyle("z-index", (Grid._columns.Count + 1 - Column?.Index).ToString(), CellType == DataGridCellType.ColumnHeader && Grid._columns.Count > 0) + .AddStyle("z-index", "1", CellType == DataGridCellType.ColumnHeader && Grid._columns.Count > 0) .AddStyle(Owner.Style) .Build(); From c9d3e96381105e2276e70563f7f80495040fbf5d Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Sun, 9 Feb 2025 13:44:30 +0100 Subject: [PATCH 2/3] Add z-index constant --- src/Core/Components/DataGrid/FluentDataGridCell.razor.cs | 2 +- src/Core/DesignTokens/Z-Index.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs index 3bec9eb116..dba5bf0e73 100644 --- a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs +++ b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs @@ -80,7 +80,7 @@ public partial class FluentDataGridCell : FluentComponentBase .AddStyle("height", "100%", Grid.MultiLine) .AddStyle("min-height", "44px", Owner.RowType != DataGridRowType.Default) .AddStyle("display", "flex", ShouldHaveDisplayFlex()) - .AddStyle("z-index", "1", CellType == DataGridCellType.ColumnHeader && Grid._columns.Count > 0) + .AddStyle("z-index", ZIndex.DataGridHeaderPopup.ToString(), CellType == DataGridCellType.ColumnHeader && Grid._columns.Count > 0) .AddStyle(Owner.Style) .Build(); diff --git a/src/Core/DesignTokens/Z-Index.cs b/src/Core/DesignTokens/Z-Index.cs index ee52357624..010e682f68 100644 --- a/src/Core/DesignTokens/Z-Index.cs +++ b/src/Core/DesignTokens/Z-Index.cs @@ -1,3 +1,7 @@ +// ------------------------------------------------------------------------ +// MIT License - Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------------------ + namespace Microsoft.FluentUI.AspNetCore.Components; public static class ZIndex @@ -17,4 +21,6 @@ public static class ZIndex public static int SelectPopup { get; set; } = 9995; public static int Dialog { get; set; } = 999; + + public static int DataGridHeaderPopup { get; set; } = 5; } From e8ec5b9eb6846456aeace1810f171991fbdea3a5 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Sun, 9 Feb 2025 15:49:19 +0100 Subject: [PATCH 3/3] Fix tests --- ...ortByTests_SortByColumnIndex_Ascending.verified.razor.html | 4 ++-- ...rtByTests_SortByColumnIndex_Descending.verified.razor.html | 4 ++-- ...ortByTests_SortByColumnTitle_Ascending.verified.razor.html | 4 ++-- ...rtByTests_SortByColumnTitle_Descending.verified.razor.html | 4 ++-- ...elect_MultiSelect_Customized_Rendering.verified.razor.html | 4 ++-- ...Grid_ColumSelect_MultiSelect_Rendering.verified.razor.html | 4 ++-- ...rid_ColumSelect_SingleSelect_Rendering.verified.razor.html | 4 ++-- ...lumSelect_SingleStickySelect_Rendering.verified.razor.html | 4 ++-- ...ntDataGridTests.FluentDataGrid_Default.verified.razor.html | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Ascending.verified.razor.html b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Ascending.verified.razor.html index bd3b552699..e60ad0bf58 100644 --- a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Ascending.verified.razor.html +++ b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Ascending.verified.razor.html @@ -2,7 +2,7 @@ - -
+
Item1
@@ -12,7 +12,7 @@
+
Item2
diff --git a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Descending.verified.razor.html b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Descending.verified.razor.html index 909553dc4b..e2539642dc 100644 --- a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Descending.verified.razor.html +++ b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnIndex_Descending.verified.razor.html @@ -2,7 +2,7 @@ - -
+
Item1
@@ -12,7 +12,7 @@
+
Item2
diff --git a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Ascending.verified.razor.html b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Ascending.verified.razor.html index bd3b552699..e60ad0bf58 100644 --- a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Ascending.verified.razor.html +++ b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Ascending.verified.razor.html @@ -2,7 +2,7 @@ - -
+
Item1
@@ -12,7 +12,7 @@
+
Item2
diff --git a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Descending.verified.razor.html b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Descending.verified.razor.html index 909553dc4b..e2539642dc 100644 --- a/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Descending.verified.razor.html +++ b/tests/Core/DataGrid/DataGridSortByTests.DataGridSortByTests_SortByColumnTitle_Descending.verified.razor.html @@ -2,7 +2,7 @@ - -
+
Item1
@@ -12,7 +12,7 @@
+
Item2
diff --git a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Customized_Rendering.verified.razor.html b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Customized_Rendering.verified.razor.html index 3d5f82a0ae..8404396443 100644 --- a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Customized_Rendering.verified.razor.html +++ b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Customized_Rendering.verified.razor.html @@ -2,10 +2,10 @@ - -
+
➖
+
Name
diff --git a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Rendering.verified.razor.html b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Rendering.verified.razor.html index 62edd973bd..895df13ecb 100644 --- a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Rendering.verified.razor.html +++ b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_MultiSelect_Rendering.verified.razor.html @@ -2,14 +2,14 @@ - -
+ +
Name
diff --git a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleSelect_Rendering.verified.razor.html b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleSelect_Rendering.verified.razor.html index c9214d6730..5b9426efde 100644 --- a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleSelect_Rendering.verified.razor.html +++ b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleSelect_Rendering.verified.razor.html @@ -2,8 +2,8 @@ - - +
+
Name
diff --git a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleStickySelect_Rendering.verified.razor.html b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleStickySelect_Rendering.verified.razor.html index c9214d6730..5b9426efde 100644 --- a/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleStickySelect_Rendering.verified.razor.html +++ b/tests/Core/DataGrid/FluentDataGridColumSelectTests.FluentDataGrid_ColumSelect_SingleStickySelect_Rendering.verified.razor.html @@ -2,8 +2,8 @@ - - +
+
Name
diff --git a/tests/Core/DataGrid/FluentDataGridTests.FluentDataGrid_Default.verified.razor.html b/tests/Core/DataGrid/FluentDataGridTests.FluentDataGrid_Default.verified.razor.html index 8aa38824f0..fec9f6c8b7 100644 --- a/tests/Core/DataGrid/FluentDataGridTests.FluentDataGrid_Default.verified.razor.html +++ b/tests/Core/DataGrid/FluentDataGridTests.FluentDataGrid_Default.verified.razor.html @@ -2,7 +2,7 @@ -
+
Name