Skip to content

Commit 674c561

Browse files
committed
Fix MudWheel
1 parent 1db339a commit 674c561

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/CodeBeam.MudBlazor.Extensions/Components/CodeInput/MudCodeInput.razor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,15 @@ public async Task SetValueFromOutside(T? value)
312312
}
313313
else
314314
{
315-
await _elementReferences[i].SetText(null);
315+
await _elementReferences[i].SetText(string.Empty);
316316
}
317317
}
318318
}
319319

320+
/// <summary>
321+
///
322+
/// </summary>
323+
/// <returns></returns>
320324
protected override IConverter<T?, string?> GetDefaultConverter()
321325
{
322326
return new DefaultConverter<T>

src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
if (0 <= index - a)
2020
{
2121
<div class="@OuterItemClassname(index - a)" @onclick="@(async() => await ChangeWheel(-a))">
22-
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index - a]) : Converter.Convert(ItemCollection[index - a]))</MudText>
22+
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index - a]) : ConvertSet(ItemCollection[index - a]))</MudText>
2323
</div>
2424
}
2525
else
@@ -31,7 +31,7 @@
3131
<span class="@BorderClassname" />
3232

3333
<div class="@MiddleItemClassname">
34-
<MudText Class="@($"mud-wheel-ani-{_animateGuid} my-2)")" Typo="@(Dense ? Typo.body1 : Typo.h6)" Color="@Color" Style="font-weight: 900">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index]) : Converter.Convert(ItemCollection[index]))</MudText>
34+
<MudText Class="@($"mud-wheel-ani-{_animateGuid} my-2)")" Typo="@(Dense ? Typo.body1 : Typo.h6)" Color="@Color" Style="font-weight: 900">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index]) : ConvertSet(ItemCollection[index]))</MudText>
3535
</div>
3636

3737
<div class="@BorderClassname" />
@@ -42,7 +42,7 @@
4242
if (index + a < ItemCollection?.Count)
4343
{
4444
<div class="@OuterItemClassname(index + a)" @onclick="@(async() => await ChangeWheel(a))">
45-
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index + a]) : Converter.Convert(ItemCollection[index + a]))</MudText>
45+
<MudText Typo="@(Dense ? Typo.body1 : Typo.h6)">@(ToStringFunc != null ? ToStringFunc(ItemCollection[index + a]) : ConvertSet(ItemCollection[index + a]))</MudText>
4646
</div>
4747
}
4848
else

src/CodeBeam.MudBlazor.Extensions/Components/Wheel/MudWheel.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public partial class MudWheel<T> : MudBaseInput<T>
7575
///
7676
/// </summary>
7777
[Parameter]
78-
public List<T?>? ItemCollection { get; set; }
78+
public List<T?> ItemCollection { get; set; } = new();
7979

8080
/// <summary>
8181
/// Determines how many items will show before and after the middle one.
@@ -282,5 +282,7 @@ public async Task RefreshAnimate()
282282
/// </summary>
283283
/// <returns></returns>
284284
protected int GetAnimateValue() => Dense ? 24 : 42;
285+
286+
285287
}
286288
}

0 commit comments

Comments
 (0)