fix: restore visibility select behavior

This commit is contained in:
2026-05-05 00:48:15 +02:00
parent f8b09be399
commit 6b18051073
2 changed files with 5 additions and 8 deletions

View File

@@ -60,9 +60,8 @@
<div class="chip-toolbar"> <div class="chip-toolbar">
<label class="visibility-control" for="roll-visibility">Visibility</label> <label class="visibility-control" for="roll-visibility">Visibility</label>
<select id="roll-visibility" <select id="roll-visibility"
@bind:get="NormalizedRollVisibility" value="@(RollVisibility == "private" ? "private" : "public")"
@bind:set="OnRollVisibilityChangedAsync" @onchange="OnRollVisibilityChangedAsync">
@bind:event="oninput">
<option value="public">Public</option> <option value="public">Public</option>
<option value="private">Private</option> <option value="private">Private</option>
</select> </select>

View File

@@ -70,9 +70,10 @@ public partial class CharacterPanel
await SkillUpdated.InvokeAsync(skillId); await SkillUpdated.InvokeAsync(skillId);
} }
private async Task OnRollVisibilityChangedAsync(string? selectedVisibility) private async Task OnRollVisibilityChangedAsync(ChangeEventArgs args)
{ {
await RollVisibilityChanged.InvokeAsync(selectedVisibility ?? "public"); var selectedVisibility = args.Value?.ToString() ?? "public";
await RollVisibilityChanged.InvokeAsync(selectedVisibility);
} }
private async Task RollSkillAsync(CharacterSheetSkill skill) private async Task RollSkillAsync(CharacterSheetSkill skill)
@@ -371,9 +372,6 @@ public partial class CharacterPanel
[Parameter] public EventCallback<string> RollVisibilityChanged { get; set; } [Parameter] public EventCallback<string> RollVisibilityChanged { get; set; }
private string NormalizedRollVisibility =>
string.Equals(RollVisibility, "private", StringComparison.OrdinalIgnoreCase) ? "private" : "public";
[Parameter] public Func<Guid, string> OwnerLabel { get; set; } = _ => string.Empty; [Parameter] public Func<Guid, string> OwnerLabel { get; set; } = _ => string.Empty;
[Parameter] public Func<CharacterSheetSkill, string> SkillDefinitionLabel { get; set; } = _ => string.Empty; [Parameter] public Func<CharacterSheetSkill, string> SkillDefinitionLabel { get; set; } = _ => string.Empty;