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
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public MudComboBox()
[Category(CategoryTypes.FormComponent.Appearance)]
[Parameter] public bool Editable { get; set; }

/// <summary>
/// If true, all items are eligible regarding what user search in textfield. Default is false.
/// </summary>
[Category(CategoryTypes.FormComponent.Appearance)]
[Parameter] public bool DisableFilter { get; set; } = false;

/// <summary>
/// If true, searched text has highlight.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected internal void CheckEligible()

protected bool IsEligible()
{
if (MudComboBox == null || MudComboBox.Editable == false)
if (MudComboBox == null || MudComboBox.Editable == false || MudComboBox.DisableFilter == true)
{
return true;
}
Expand Down
6 changes: 4 additions & 2 deletions ComponentViewer.Docs/Pages/Examples/ComboboxExample7.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MudGrid>
<MudItem xs="12" sm="8" Class="d-flex gap-4 align-center justify-center">
<MudComboBox @bind-Value="@_value" @bind-Text="@_text" @bind-SelectedValues="@_selectedValues" Variant="Variant.Filled" Label="Highlighted" Editable="true" MultiSelection="@_multiselection"
autocomplete="new-password" Color="_color" Clearable="_clearable" Strict="_strict" Highlight="true" HighlightClass="@(_customHighlightClass ? "mud-theme-primary" : null)">
autocomplete="new-password" Color="_color" Clearable="_clearable" Strict="_strict" Highlight="true" HighlightClass="@(_customHighlightClass ? "mud-theme-primary" : null)" DisableFilter="_disableFilter">
<MudComboBoxItem Value="@("Foo")">Foo</MudComboBoxItem>
<MudComboBoxItem Value="@("Bar")">Bar</MudComboBoxItem>
<MudComboBoxItem Value="@("Fizz")">Fizz</MudComboBoxItem>
Expand All @@ -16,7 +16,7 @@
</MudComboBox>

<MudComboBox @bind-Value="@_value" @bind-Text="@_text" @bind-SelectedValues="@_selectedValues" Variant="Variant.Filled" Label="With NoItemsContent" Editable="true" MultiSelection="@_multiselection"
autocomplete="new-password" Color="_color" Clearable="_clearable" Strict="_strict">
autocomplete="new-password" Color="_color" Clearable="_clearable" Strict="_strict" DisableFilter="_disableFilter">
<ChildContent>
<MudComboBoxItem Value="@("Foo")">Foo</MudComboBoxItem>
<MudComboBoxItem Value="@("Bar")">Bar</MudComboBoxItem>
Expand All @@ -41,6 +41,7 @@
<MudSwitchM3 @bind-Checked="@_strict" Label="Strict" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="@_clearable" Label="Clearable" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="@_customHighlightClass" Label="Custom Highlight" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="@_disableFilter" Label="Disable Filter" Color="Color.Secondary" />
</MudStack>
</MudItem>
</MudGrid>
Expand All @@ -56,6 +57,7 @@
bool _clearable;
bool _strict;
bool _customHighlightClass;
bool _disableFilter = false;

private string[] states =
{
Expand Down