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 @@ -171,7 +171,7 @@ public async Task ComboBoxTest1()
combobox.Instance.Value.Should().BeNullOrEmpty();
comp.WaitForAssertion(() => comp.Find("div.mud-popover").ClassList.Should().Contain("d-none"));
// click and check if it has toggled the menu
input.MouseDown();
input.Click();
menu.ClassList.Should().NotContain("d-none");
// now click an item and see the value change
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item").Count.Should().BeGreaterThan(0));
Expand All @@ -182,7 +182,7 @@ public async Task ComboBoxTest1()
combobox.Instance.Value.Should().Be("2");
// now we cheat and click the list without opening the menu ;)

input.MouseDown();
input.Click();
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item").Count.Should().BeGreaterThan(0));
items = comp.FindAll("div.mud-combobox-item").ToArray();

Expand All @@ -205,7 +205,7 @@ public async Task ComboBoxClearableTest()
// No button when initialized
comp.FindAll("button").Should().BeEmpty();

input.MouseDown();
input.Click();
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item").Count.Should().BeGreaterThan(0));
// Button shows after selecting item
var items = comp.FindAll("div.mud-combobox-item").ToArray();
Expand All @@ -230,7 +230,7 @@ public void MultiSelect_SelectAll()
var menu = comp.Find("div.mud-popover");
var input = combobox.Find("div.mud-input-control");
// Open the menu
input.MouseDown();
input.Click();
comp.WaitForAssertion(() => menu.ClassList.Should().Contain("mud-popover-open"));

comp.FindAll("div.mud-combobox-item")[0].Click();
Expand Down Expand Up @@ -259,7 +259,7 @@ public async Task ComboBox_MultiSelectEditable()
comp.WaitForAssertion(() =>
comp.Find("div.mud-popover").ClassList.Should().Contain("d-none"));
// click and check if it has toggled the menu
await comp.InvokeAsync(() => input.MouseDown());
await comp.InvokeAsync(() => input.Click());
comp.WaitForAssertion(() => comp.Find("div.mud-popover").ClassList.Should().NotContain("d-none"));
// now click an item and see the value change
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item").Count.Should().Be(4));
Expand Down Expand Up @@ -289,7 +289,7 @@ public async Task ComboBox_MultiSelectTest1()
comp.WaitForAssertion(() =>
comp.Find("div.mud-popover").ClassList.Should().Contain("d-none"));
// click and check if it has toggled the menu
await comp.InvokeAsync(() => input.MouseDown());
await comp.InvokeAsync(() => input.Click());
comp.WaitForAssertion(() => comp.Find("div.mud-popover").ClassList.Should().NotContain("d-none"));
// now click an item and see the value change
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item").Count.Should().BeGreaterThan(0));
Expand Down Expand Up @@ -324,7 +324,7 @@ await comp.InvokeAsync(() =>
{
combobox.Instance.SelectedValues = new HashSet<string>() { "1", "2" };
});
await comp.InvokeAsync(() => input.MouseDown());
await comp.InvokeAsync(() => input.Click());
comp.WaitForAssertion(() => comp.FindAll("div.mud-combobox-item path")[1]?.Attributes["d"]?.Value.Should().Be(@checked));
comp.FindAll("div.mud-combobox-item path")[3]?.Attributes["d"]?.Value.Should().Be(@checked);
combobox.Instance.SelectedValues.Should().NotContain("3");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<CascadingValue Value="@this" IsFixed="true">
<div class="mud-select-extended" id="@_elementId">
<MudInputControl Label="@Label" Variant="@Variant" HelperText="@HelperText" HelperTextOnFocus="@HelperTextOnFocus" FullWidth="@FullWidth" Margin="@Margin" Class="@Classname" Style="@Style"
Error="@Error" ErrorText="@ErrorText" ErrorId="@ErrorId" Disabled="@Disabled" @onmousedown="@ToggleMenu" Required="@Required" ForId="@FieldId">
Error="@Error" ErrorText="@ErrorText" ErrorId="@ErrorId" Disabled="@Disabled" @onclick="@ToggleMenu" Required="@Required" ForId="@FieldId">
<InputContent>
@*DataVisualiserStyle="@($"min-height: 1.1876em;{(HasValue(Value) && Editable == true ? "padding-bottom: 0px" : null)}")"*@
<MudInputExtended @ref="_inputReference" T="string" InputType="@(Editable && !MultiSelection ? InputType.Text : InputType.Hidden)"
Expand Down Expand Up @@ -49,20 +49,6 @@
}
}
}
@*@if (ItemCollection is not null)
{
foreach (var item in ItemCollection.Where(x => SelectedValues.Contains(x)))
{
<MudChip Class="@ChipClass" Value="@item" Text="@Converter.Set(item)" Color="@Color" Size="@ChipSize" Variant="@ChipVariant" @onmousedown:stopPropagation />
}
}
else
{
foreach (var item in Items.Where(x => (MultiSelection ? SelectedValues.Contains(x.Value) : Value?.Equals(x.Value) == true)) ?? new List<MudComboBoxItem<T>>())
{
<MudChip Class="@ChipClass" Value="item.Value" Text="@(ToStringFunc is not null ? ToStringFunc.Invoke(item.Value) : string.IsNullOrWhiteSpace(item.Text) ? Converter.Set(item.Value) : item.Text)" Color="@Color" Size="@ChipSize" Variant="@ChipVariant" @onmousedown:stopPropagation />
}
}*@
</MudChipSet>
}
else if (InputPresenter == ValuePresenter.Text && (!Editable || (MultiSelection && Editable)))
Expand Down
Loading