With mudstep there are 2 ways of navigating, through the Action buttons at the bottom or through the Step icons at the top. If you have validation on a per step basis and the user tries to use the Step icons at the top to jump to a later step, it is hard to validate this without knowning which Step the user clicked / is trying to navigate to. At the moment PreventStepChangeAsync only tells the direction and if you do a _stepper!.GetActiveIndex() it returns the current index and theres no way to know which index the user is trying to jump to. This isnt a problem with the bottom Action buttons navigation since it will always be the next step. If you try to do the validation on the ActiveStepChanged which happens afterwards PreventStepChangeAsync , it is already too late and even if you validate and call SetActiveStepByIndex(), you still get a flash screen (not ideal...) since its basically rendering the step the user clicked and then sending the user back to the one set by SetActiveStepByIndex.
With mudstep there are 2 ways of navigating, through the Action buttons at the bottom or through the Step icons at the top. If you have validation on a per step basis and the user tries to use the Step icons at the top to jump to a later step, it is hard to validate this without knowning which Step the user clicked / is trying to navigate to. At the moment PreventStepChangeAsync only tells the direction and if you do a _stepper!.GetActiveIndex() it returns the current index and theres no way to know which index the user is trying to jump to. This isnt a problem with the bottom Action buttons navigation since it will always be the next step. If you try to do the validation on the ActiveStepChanged which happens afterwards PreventStepChangeAsync , it is already too late and even if you validate and call SetActiveStepByIndex(), you still get a flash screen (not ideal...) since its basically rendering the step the user clicked and then sending the user back to the one set by SetActiveStepByIndex.
Solution:
PreventStepChangeAsync
[Parameter] public Func<StepChangeDirection, **int SelectedIndex**, Task<bool>> PreventStepChangeAsync { get; set; }