-@using MudExtensions.Utilities
ScrollManager.LockScrollAsync() )" @onmouseleave="@(() => ScrollManager.UnlockScrollAsync())" @onclick:stopPropagation>
@if (!string.IsNullOrEmpty(Label))
diff --git a/src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs b/src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs
index c0870330..59eeb873 100644
--- a/src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs
+++ b/src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using MudBlazor;
-using MudBlazor.Extensions;
using MudBlazor.Utilities;
namespace MudExtensions
@@ -12,10 +11,15 @@ namespace MudExtensions
///
public partial class MudWheel : MudBaseInput
{
+ private int _animateValue = 52;
+ private MudAnimate _animate = new();
+ private readonly Guid _animateGuid = Guid.NewGuid();
+
///
///
///
- [Inject] public IScrollManager ScrollManager { get; set; } = null!;
+ [Inject]
+ public IScrollManager ScrollManager { get; set; } = null!;
///
///
@@ -67,15 +71,11 @@ public partial class MudWheel : MudBaseInput
.AddClass("wheel-item-empty-dense", Dense)
.Build();
- MudAnimate _animate = new();
- Guid _animateGuid = Guid.NewGuid();
- int _animateValue = 52;
-
///
///
///
[Parameter]
- public List ItemCollection { get; set; } = new();
+ public List? ItemCollection { get; set; } = new();
///
/// Determines how many items will show before and after the middle one.
@@ -113,7 +113,6 @@ public partial class MudWheel : MudBaseInput
[Parameter]
public Color Color { get; set; }
- private Func? _toStringFunc = x => x?.ToString();
///
/// Defines how values are displayed in the drop-down list
///
@@ -258,7 +257,7 @@ public async Task ChangeWheel(int changeCount)
}
await _animate.Refresh();
- T val = ItemCollection[index + changeCount];
+ T? val = ItemCollection is not null ? ItemCollection[index + changeCount] : default;
await SetValueAsync(val);
}
@@ -282,7 +281,5 @@ public async Task RefreshAnimate()
///
///
protected int GetAnimateValue() => Dense ? 24 : 42;
-
-
}
}
diff --git a/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor b/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor
index c33e55f0..32d4d2ba 100644
--- a/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor
+++ b/tests/CodeBeam.MudBlazor.Extensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor
@@ -28,7 +28,7 @@
await base.OnInitializedAsync();
}
- private string ToString(TestItem x)
+ private string ToString(TestItem? x)
=> x is null ? string.Empty : $"{x.A}";
private class TestItem
diff --git a/tests/CodeBeam.MudBlazor.Extensions.UnitTests/Components/ChipFieldTests.cs b/tests/CodeBeam.MudBlazor.Extensions.UnitTests/Components/ChipFieldTests.cs
index 4a960388..03609994 100644
--- a/tests/CodeBeam.MudBlazor.Extensions.UnitTests/Components/ChipFieldTests.cs
+++ b/tests/CodeBeam.MudBlazor.Extensions.UnitTests/Components/ChipFieldTests.cs
@@ -1,9 +1,7 @@
using Bunit;
using AwesomeAssertions;
using Microsoft.AspNetCore.Components;
-using Microsoft.AspNetCore.Components.Web;
using MudBlazor.Extensions;
-using MudExtensions.Docs.Examples;
namespace MudExtensions.UnitTests.Components
{
@@ -20,7 +18,7 @@ public async Task ChipFieldBasicTest()
var field = comp.FindComponent>();
field.Find("input").Input(new ChangeEventArgs() { Value = "sdfg" });
await comp.InvokeAsync(() => comp.Instance.HandleBeforeInput(new BeforeInputEventArgs() { Data = " ", InputType = "insert" }));
- comp.Instance.Values.Should().BeEquivalentTo(new List { "asdf", "asd", "sdfg" });
+ comp.Instance.GetState(x => x.Values).Should().BeEquivalentTo(new List { "asdf", "asd", "sdfg" });
comp.Instance.GetState(x => x.Value).Should().BeEquivalentTo(null);
}
}