fix(welcome): FlavourStep notifies host on select so Next enables immediately

WIP on local branch feat/wizard-recipes (NOT pushed) — holding per operator while
more wizard changes (role app-recipes) are designed.
This commit is contained in:
sysadmin
2026-06-09 21:45:20 +01:00
parent daac231148
commit 6d6eb2cdc8
2 changed files with 9 additions and 3 deletions

View File

@@ -37,7 +37,7 @@
<WelcomeStep />
break;
case 1:
<FlavourStep Flavours="_flavours" />
<FlavourStep Flavours="_flavours" OnSelected="StateHasChanged" />
break;
case 2:
<AccountStep OnValidityChanged="@(v => { _accountValid = v; StateHasChanged(); })" />

View File

@@ -19,13 +19,19 @@
@code {
[Parameter] public IReadOnlyList<FlavourManifest> Flavours { get; set; } = Array.Empty<FlavourManifest>();
protected override void OnInitialized()
/// <summary>Notifies the wizard host when the selection changes so it re-evaluates
/// the Next button (otherwise Next stays disabled until a back/forward re-render).</summary>
[Parameter] public EventCallback OnSelected { get; set; }
protected override async Task OnInitializedAsync()
{
State.Flavour ??= Flavours.FirstOrDefault(f => f.IsDefault);
await OnSelected.InvokeAsync();
}
void Select(FlavourManifest f)
async Task Select(FlavourManifest f)
{
State.Flavour = f;
await OnSelected.InvokeAsync();
}
}