From 64ee5c4d74aa9bf39575736228864f7251359b55 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Tue, 18 Feb 2025 10:11:58 +0100 Subject: [PATCH 1/3] Fix 3379 by setting position in inline style when multiple --- .../List/Select/Examples/SelectMultipleWithFunctions.razor | 6 +++--- src/Core/Components/List/FluentSelect.razor.cs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/Demo/Shared/Pages/List/Select/Examples/SelectMultipleWithFunctions.razor b/examples/Demo/Shared/Pages/List/Select/Examples/SelectMultipleWithFunctions.razor index 6f135bb4c6..656c028df3 100644 --- a/examples/Demo/Shared/Pages/List/Select/Examples/SelectMultipleWithFunctions.razor +++ b/examples/Demo/Shared/Pages/List/Select/Examples/SelectMultipleWithFunctions.razor @@ -3,7 +3,7 @@

All people whose first name starts with a "J" are initialy selected through the OptionSelected (Func delegate) parameter.

All people with a birth year greater than 1990 are disabled through the OptionDisabled (Func delegate) parameter.

-
+ -
+

Selected value: @SelectedValue
@@ -35,4 +35,4 @@ { IEnumerable? SelectedOptions; string? SelectedValue; -} \ No newline at end of file +} diff --git a/src/Core/Components/List/FluentSelect.razor.cs b/src/Core/Components/List/FluentSelect.razor.cs index 594d312182..38f50cdcd4 100644 --- a/src/Core/Components/List/FluentSelect.razor.cs +++ b/src/Core/Components/List/FluentSelect.razor.cs @@ -1,3 +1,7 @@ +// ------------------------------------------------------------------------ +// MIT License - Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------------------ + using Microsoft.AspNetCore.Components; using Microsoft.FluentUI.AspNetCore.Components.Utilities; @@ -13,6 +17,7 @@ public partial class FluentSelect : ListComponentBase where TO ///

protected virtual MarkupString InlineStyleValue => new InlineStyleBuilder() + .AddStyle($"#{Id}::part(listbox)", "position", "relative", Multiple) .AddStyle($"#{Id}::part(listbox)", "max-height", Height, !string.IsNullOrWhiteSpace(Height)) .AddStyle($"#{Id}::part(listbox)", "height", "fit-content", !string.IsNullOrWhiteSpace(Height)) .AddStyle($"#{Id}::part(listbox)", "z-index", ZIndex.SelectPopup.ToString()) From aca672391d4b4e689a8fbeb93830742bba0704e6 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Tue, 18 Feb 2025 10:44:09 +0100 Subject: [PATCH 2/3] Fix typo in Templates.md --- examples/Demo/Shared/wwwroot/docs/Templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Demo/Shared/wwwroot/docs/Templates.md b/examples/Demo/Shared/wwwroot/docs/Templates.md index 197ff4ff2b..9c8870dfa3 100644 --- a/examples/Demo/Shared/wwwroot/docs/Templates.md +++ b/examples/Demo/Shared/wwwroot/docs/Templates.md @@ -25,7 +25,7 @@ The pages created from these templates will appear like the following based on t You can install the templates by running the following command: ```cshtml -dotnet new install Microsoft.FluentUI.AspNetCore.TemplatesCopy +dotnet new install Microsoft.FluentUI.AspNetCore.Templates ``` The current version can be found on the [NuGet site](https://www.nuget.org/packages/Microsoft.FLuentUI.AspNetCore.Templates/). From 09a0adfb3015e8e5e6f3269dcf1197d771795635 Mon Sep 17 00:00:00 2001 From: Vincent Baaij Date: Mon, 24 Feb 2025 13:33:51 +0100 Subject: [PATCH 3/3] Only use z-index when Multiple is false --- src/Core/Components/List/FluentSelect.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Components/List/FluentSelect.razor.cs b/src/Core/Components/List/FluentSelect.razor.cs index 38f50cdcd4..d9f7a1d453 100644 --- a/src/Core/Components/List/FluentSelect.razor.cs +++ b/src/Core/Components/List/FluentSelect.razor.cs @@ -20,7 +20,7 @@ public partial class FluentSelect : ListComponentBase where TO .AddStyle($"#{Id}::part(listbox)", "position", "relative", Multiple) .AddStyle($"#{Id}::part(listbox)", "max-height", Height, !string.IsNullOrWhiteSpace(Height)) .AddStyle($"#{Id}::part(listbox)", "height", "fit-content", !string.IsNullOrWhiteSpace(Height)) - .AddStyle($"#{Id}::part(listbox)", "z-index", ZIndex.SelectPopup.ToString()) + .AddStyle($"#{Id}::part(listbox)", "z-index", ZIndex.SelectPopup.ToString(), !Multiple) .AddStyle($"#{Id}::part(selected-value)", "white-space", "nowrap") .AddStyle($"#{Id}::part(selected-value)", "overflow", "hidden") .AddStyle($"#{Id}::part(selected-value)", "text-overflow", "ellipsis")