Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

</p>

<div style="display: block; height: 300px;">
<label for="people-listbox2">Select persons</label>
<FluentListbox TOption="Person"
Items="@Data.People"
Id="people-listbox2"
Multiple="true"
OptionValue="@(p => p.PersonId.ToString())"
OptionText="@(p => p.LastName + ", " + p.FirstName)"
@bind-Value="@SelectedValue"
@bind-SelectedOptions="@SelectedOptions" />
<div style="display: block; height: 320px;">
<label for="people-listbox2">Select persons</label>
<FluentListbox TOption="Person"
Items="@Data.People"
Id="people-listbox2"
Multiple="true"
OptionValue="@(p => p.PersonId.ToString())"
OptionText="@(p => p.LastName + ", " + p.FirstName)"
@bind-Value="@SelectedValue"
@bind-SelectedOptions="@SelectedOptions" />

</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ο»Ώ<p>
<em>Size parameter not working correctly yet!</em> However, the component supports both Height and Width parameters
<em>Size parameter not working correctly yet!</em> However, the component supports Style parameters
which can be used to determine the size of the displayed listbox
</p>

<FluentListbox ValueChanged="@(e => listboxValue = e)" Size=7 TOption="string" Height="200px">
<FluentListbox ValueChanged="@(e => listboxValue = e)" Size=7 TOption="string" Style="width:15rem;">
<FluentOption Value="AL">Alabama</FluentOption>
<FluentOption Value="AK">Alaska</FluentOption>
<FluentOption Value="AZ">Arizona</FluentOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

</p>

<div style="display: block; height: 300px;">
<label for="people-listbox2">Select persons</label>
<FluentListbox TOption="Person"
Items="@Data.People"
Id="people-listbox2"
Multiple="true"
OptionValue="@(p => p.PersonId.ToString())"
OptionText="@(p => p.LastName + ", " + p.FirstName)"
@bind-Value="@SelectedValue"
@bind-SelectedOptions="@SelectedOptions" />
<div style="display: block; height: 320px;">
<label for="people-listbox2">Select persons</label>
<FluentListbox TOption="Person"
Items="@Data.People"
Id="people-listbox2"
Multiple="true"
OptionValue="@(p => p.PersonId.ToString())"
OptionText="@(p => p.LastName + ", " + p.FirstName)"
@bind-Value="@SelectedValue"
@bind-SelectedOptions="@SelectedOptions" />

</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ο»Ώ<p>
<em>Size parameter not working correctly yet!</em> However, the component supports both Height and Width parameters
<em>Size parameter not working correctly yet!</em> However, the component supports Style parameters
which can be used to determine the size of the displayed listbox
</p>

<FluentListbox ValueChanged="@(e => listboxValue = e)" Size=7 TOption="string" Height="200px">
<FluentListbox ValueChanged="@(e => listboxValue = e)" Size=7 TOption="string" Style="width:15rem;">
<FluentOption Value="AL">Alabama</FluentOption>
<FluentOption Value="AK">Alaska</FluentOption>
<FluentOption Value="AZ">Arizona</FluentOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
@inherits ListComponentBase<TOption>
@typeparam TOption
<CascadingValue Value="@_internalListContext" Name="ListContext" TValue="InternalListContext<TOption>" IsFixed="true">
<div style="overflow-y: auto; max-height: @Height; max-width: @Width;">
<fluent-listbox @ref=Element
id="@Id"
class="@ClassValue"
style="@StyleValue; width: calc(100% - 8px);"
disabled=@Disabled
size="@Size"
multiple="@Multiple"
selectedOptions="@(SelectedOptions != null && SelectedOptions.Any() ? string.Join(',', SelectedOptions.Select(i => GetOptionValue(i))) : null)"
aria-label="@(!string.IsNullOrWhiteSpace(Title) ? Title : "")"
@onchange="@OnChangedHandlerAsync"
@attributes="AdditionalAttributes">
@GetListOptions(Items)
</fluent-listbox>
</div>
<fluent-listbox @ref="Element"
id="@Id"
class="@ClassValue"
style="@StyleValue"
disabled="@Disabled"
size="@Size"
multiple="@Multiple"
selectedOptions="@(SelectedOptions != null && SelectedOptions.Any() ? string.Join(',', SelectedOptions.Select(i => GetOptionValue(i))) : null)"
aria-label="@(!string.IsNullOrWhiteSpace(Title) ? Title : "")"
@onchange="@OnChangedHandlerAsync"
@attributes="AdditionalAttributes">
@GetListOptions(Items)
</fluent-listbox>
</CascadingValue>
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ namespace Microsoft.Fast.Components.FluentUI;
[CascadingTypeParameter(nameof(TOption))]
public partial class FluentListbox<TOption> : ListComponentBase<TOption>
{
/// <summary>
/// Width style
/// </summary>

[Parameter]
public string Width { get; set; } = "250px";

/// <summary>
/// Height style
/// </summary>
[Parameter]
public string Height { get; set; } = "350px";

/// <summary>
/// The maximum number of options that should be visible in the listbox scroll area.
/// </summary>
Expand Down