Skip to content

Commit ce43fde

Browse files
vnbaaijdvoituron
andauthored
Fix 3379 by setting position in inline style when multiple (#3380)
Co-authored-by: Denis Voituron <dvoituron@outlook.com>
1 parent ae538e7 commit ce43fde

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

examples/Demo/Shared/Pages/List/Select/Examples/SelectMultipleWithFunctions.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<p>All people whose first name starts with a "J" are initialy selected through the <code>OptionSelected</code> (Func delegate) parameter.</p>
44
<p>All people with a birth year greater than 1990 are disabled through the <code>OptionDisabled</code> (Func delegate) parameter.</p>
55

6-
<div style="display: block; height: 300px;">
6+
77
<FluentSelect TOption="Person"
88
Label="Select persons"
99
Items="@Data.People"
@@ -15,7 +15,7 @@
1515
OptionSelected="@(p => p.FirstName.StartsWith("J"))"
1616
@bind-Value="@SelectedValue"
1717
@bind-SelectedOptions="@SelectedOptions" />
18-
</div>
18+
1919

2020
<p>
2121
Selected value: @SelectedValue <br />
@@ -35,4 +35,4 @@
3535
{
3636
IEnumerable<Person>? SelectedOptions;
3737
string? SelectedValue;
38-
}
38+
}

src/Core/Components/List/FluentSelect.razor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// ------------------------------------------------------------------------
2+
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
3+
// ------------------------------------------------------------------------
4+
15
using Microsoft.AspNetCore.Components;
26
using Microsoft.FluentUI.AspNetCore.Components.Utilities;
37

@@ -13,6 +17,7 @@ public partial class FluentSelect<TOption> : ListComponentBase<TOption> where TO
1317

1418
/// <summary />
1519
protected virtual MarkupString InlineStyleValue => new InlineStyleBuilder()
20+
.AddStyle($"#{Id}::part(listbox)", "position", "relative", Multiple)
1621
.AddStyle($"#{Id}::part(listbox)", "max-height", Height, !string.IsNullOrWhiteSpace(Height))
1722
.AddStyle($"#{Id}::part(listbox)", "height", "fit-content", !string.IsNullOrWhiteSpace(Height))
1823
.AddStyle($"#{Id}::part(listbox)", "z-index", ZIndex.SelectPopup.ToString())

0 commit comments

Comments
 (0)