Skip to content

Commit

Permalink
🐛 fix(Radio): OnIcon and OffIcon don't work (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Apr 23, 2023
1 parent baeb254 commit 148fb31
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Masa.Blazor/Components/Radio/MRadio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ public class MRadio<TValue> : BRadio<TValue>

protected string ValidationState => RadioGroup?.ValidationState ?? "primary";

public override async Task SetParametersAsync(ParameterView parameters)
{
OnIcon = "mdi-radiobox-marked";
OffIcon = "mdi-radiobox-blank";

await base.SetParametersAsync(parameters);
}

protected override void OnInitialized()
{
base.OnInitialized();
Expand All @@ -18,6 +26,7 @@ protected override void OnInitialized()
protected override void SetComponentClass()
{
var prefix = "m-radio";

CssProvider
.Apply(cssBuilder =>
{
Expand Down Expand Up @@ -46,9 +55,6 @@ protected override void SetComponentClass()
attrs[nameof(MIcon.IsActive)] = IsActive;
})
.Apply<BLabel, MLabel>();

OnIcon = "mdi-radiobox-marked";
OffIcon = "mdi-radiobox-blank";
}
}
}

0 comments on commit 148fb31

Please sign in to comment.