diff --git a/.gitignore b/.gitignore index 17d8f52c6a..5c9ba1a1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -411,5 +411,4 @@ Microsoft.Fast.Components.FluentUI.xml /examples/Demo/Shared/Microsoft.Fast.Components.FluentUI.xml /tests/TemplateValidation/**/Data/Migrations /tests/TemplateValidation/**/Data/* -/global.json /spelling.dic diff --git a/WHATSNEW.md b/WHATSNEW.md index b1d548fa72..14c62806a9 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -1,3 +1,9 @@ +## V4.11.3 + +### Components +- \[DataGrid\] Fix cell height issue and make header really sticky ([#3173](https://github.com/microsoft/fluentui-blazor/pull/3173)) +- \[Tabs\] Remove height compensation ([#3149](https://github.com/microsoft/fluentui-blazor/pull/3149)) + ## V4.11.2 ### Components @@ -5,7 +11,6 @@ - \[DataGrid\] Tweak `display: flex` and DataGridDisplayMode.Table ([#3156](https://github.com/microsoft/fluentui-blazor/pull/3156)) - \[DataGrid\] Make Empty/Loading row not respond to hover and `OnRowClick` ([#3166](https://github.com/microsoft/fluentui-blazor/pull/3166)) - ## V4.11.1 ### Components diff --git a/examples/Demo/Shared/Pages/DataGrid/Examples/DataGridTypical.razor.css b/examples/Demo/Shared/Pages/DataGrid/Examples/DataGridTypical.razor.css index 49724e23df..4ec36fa5e4 100644 --- a/examples/Demo/Shared/Pages/DataGrid/Examples/DataGridTypical.razor.css +++ b/examples/Demo/Shared/Pages/DataGrid/Examples/DataGridTypical.razor.css @@ -1,7 +1,7 @@ /* Ensure all the flags are the same size, and centered */ .flag { height: 1rem; - margin-top: 7px; + margin-top: 4px; border: 1px solid var(--neutral-layer-3); } .search-box { diff --git a/examples/Demo/Shared/Pages/Home/Home.razor b/examples/Demo/Shared/Pages/Home/Home.razor index e72adc407c..38c063a2c5 100644 --- a/examples/Demo/Shared/Pages/Home/Home.razor +++ b/examples/Demo/Shared/Pages/Home/Home.razor @@ -34,7 +34,7 @@

The demo and documentation sites for previous version is available:
- Version 3.7.9
+ Version 3.8.0
Please be aware that this version is no longer supported as both .NET 6 and .NET 7 are out of support now.

diff --git a/examples/Demo/Shared/Pages/Lab/IssueTester.razor b/examples/Demo/Shared/Pages/Lab/IssueTester.razor index e02abfc9b0..92ba60dfd0 100644 --- a/examples/Demo/Shared/Pages/Lab/IssueTester.razor +++ b/examples/Demo/Shared/Pages/Lab/IssueTester.razor @@ -1 +1,64 @@ - +@page "/test" + + + + +
+ + + @context.a + + + @context.b + + + @context.c + + +
+ + +@code { + class Testt + { + public string a = "a"; + public string b = "b"; + public string c = "c"; + } + + private List testList = new() + { + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + new(), + }; +} diff --git a/examples/Demo/Shared/wwwroot/docs/WhatsNew.md b/examples/Demo/Shared/wwwroot/docs/WhatsNew.md index d85524a855..6912669710 100644 --- a/examples/Demo/Shared/wwwroot/docs/WhatsNew.md +++ b/examples/Demo/Shared/wwwroot/docs/WhatsNew.md @@ -1,3 +1,9 @@ +## V4.11.3 + +### Components +- \[DataGrid\] Fix cell height issue and make header really sticky ([#3173](https://github.com/microsoft/fluentui-blazor/pull/3173)) +- \[Tabs\] Remove height compensation ([#3149](https://github.com/microsoft/fluentui-blazor/pull/3149)) + ## V4.11.2 ### Components diff --git a/global.json b/global.json new file mode 100644 index 0000000000..b6b5c9f588 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "9.0.101" + } +} diff --git a/src/Core/Components/DataGrid/FluentDataGrid.razor.cs b/src/Core/Components/DataGrid/FluentDataGrid.razor.cs index 4bec6dbd0e..cc3b683d00 100644 --- a/src/Core/Components/DataGrid/FluentDataGrid.razor.cs +++ b/src/Core/Components/DataGrid/FluentDataGrid.razor.cs @@ -802,9 +802,11 @@ private string AriaSortValue(ColumnBase column) : "none"; private string? StyleValue => new StyleBuilder(Style) - .AddStyle("grid-template-columns", _internalGridTemplateColumns, !string.IsNullOrWhiteSpace(_internalGridTemplateColumns)) + .AddStyle("grid-template-columns", _internalGridTemplateColumns, !string.IsNullOrWhiteSpace(_internalGridTemplateColumns) && DisplayMode == DataGridDisplayMode.Grid) .AddStyle("grid-template-rows", "auto 1fr", _internalGridContext.Items.Count == 0 || Items is null) .AddStyle("height", $"calc(100% - {(int)RowSize}px)", _internalGridContext.TotalItemCount == 0 || EffectiveLoadingValue) + .AddStyle("border-collapse", "separate", GenerateHeader == GenerateHeaderOption.Sticky) + .AddStyle("border-spacing", "0", GenerateHeader == GenerateHeaderOption.Sticky) .Build(); private string? ColumnHeaderClass(ColumnBase column) diff --git a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs index 29ad68911b..17fa21ac6e 100644 --- a/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs +++ b/src/Core/Components/DataGrid/FluentDataGridCell.razor.cs @@ -75,7 +75,7 @@ public partial class FluentDataGridCell : FluentComponentBase .AddStyle("padding-top", "calc(var(--design-unit) * 2.5px)", Column is SelectColumn && (Grid.RowSize == DataGridRowSize.Medium || Owner.RowType == DataGridRowType.Header)) .AddStyle("padding-top", "calc(var(--design-unit) * 1.5px)", Column is SelectColumn && Grid.RowSize == DataGridRowSize.Small && Owner.RowType == DataGridRowType.Default) .AddStyle("width", Column?.Width, !string.IsNullOrEmpty(Column?.Width) && Grid.DisplayMode == DataGridDisplayMode.Table) - .AddStyle("height", $"{Grid.ItemSize:0}px", () => !Grid.EffectiveLoadingValue && Grid.Virtualize && Owner.RowType == DataGridRowType.Default && CellType == DataGridCellType.ColumnHeader) + .AddStyle("height", $"{Grid.ItemSize:0}px", () => !Grid.EffectiveLoadingValue && Grid.Virtualize && Owner.RowType == DataGridRowType.Default) .AddStyle("height", $"{(int)Grid.RowSize}px", () => !Grid.EffectiveLoadingValue && !Grid.Virtualize && Grid.Items is not null && !Grid.MultiLine) .AddStyle("height", "100%", Grid.MultiLine) .AddStyle("min-height", "44px", Owner.RowType != DataGridRowType.Default)