This issue has to do with keyboard support, where if the step index is changed programmatically, and then the user tabs back onto the wizard stepper, then the focus class is on the wrong step. The active step is correct in the stepper, but the focus outline is on the step prior to the programmatic index change. I have created a repl here:
https://blazorrepl.telerik.com/wcbmlAlj23ZwNsxf21
If you click the Move to 3rd Step button it will switch the wizard to the 3rd step correctly.
Tab to the stepper, and step 1 will have the outline focus class, the focus will actually be on the correct step (step 3).
Pressing the right arrow key will move to Active Step 4, but the outline focus class will be moved to step 2.
Pressing the left arrow key will then fix the outline class.
I would expect that when changing the step index programmatically, that the outline focus class on the stepper would be displayed for the step that the index was changed to. It becomes confusing for keyboard users.
The disable option is still showing the step and it is not good for me. I have 35 types of transactions and all of them have generic and specific step.
---
ADMIN EDIT
Here is a potential workaround - basic conditional markup can add or remove steps. The key thing is that they will be added to the end of the wizard if they had not been rendered. To handle this, dispose and re-initialize the component, so the step will be rendered at the correct position.
If you have complex steps, you can work around this by creating a collection of descriptor models for the list of steps and create the steps based on that collection, where you can keep the VIsible flag, in a fashion similar to this example for the TabStrip.
<TelerikButton OnClick="@ToggleStep">Toggle attachments step visibility</TelerikButton>
@if (WizardVisible)
{
<TelerikWizard @bind-Value="@CurrStepIndex">
<WizardSteps>
<WizardStep Label="Personal Details" Icon="SvgIcon.User">
<Content>
content here
</Content>
</WizardStep>
@if (AttachmentsStepVisible)
{
<WizardStep Label="Attachments" Icon="SvgIcon.Paperclip">
<Content>
conditional content here
</Content>
</WizardStep>
}
<WizardStep Label="Confirmation" Icon="SvgIcon.Check">
<Content>
other content here
</Content>
</WizardStep>
</WizardSteps>
</TelerikWizard>
}
@code {
private bool AttachmentsStepVisible { get; set; }
private bool WizardVisible { get; set; } = true;
private int CurrStepIndex { get; set; }
private async void ToggleStep()
{
//dispose the Wizard
WizardVisible = false;
// defence against hiding the step when it is the last step, which would cause an exception
if (AttachmentsStepVisible && CurrStepIndex == 2)
{
CurrStepIndex = 1;
}
//the actual visibility toggle
AttachmentsStepVisible = !AttachmentsStepVisible;
//allow some time for the disposal and toggling the step visibility prior to re-initialization
await Task.Delay(10);
//re-initialize the Wizard
WizardVisible = true;
StateHasChanged();
}
}---
When you try to use Wizard with only one step inside, the following error appears:
"ArgumentException: The "Max" value should be greater than 0."
If you have more than one step, everything works as expected.
----------ADMIN EDIT-----------
To avoid the exception, you can use at least two steps inside the Wizard.