We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0db5c96 commit 643c92bCopy full SHA for 643c92b
src/wizard/wizard-step-list.tsx
@@ -46,8 +46,15 @@ export function getStepStatus(
46
if (farthestStepIndex >= index) {
47
return StepStatusValues.Visited;
48
}
49
- if (allowSkipTo && canSkip(activeStepIndex + 1, index, steps)) {
50
- return StepStatusValues.Next;
+ if (allowSkipTo && index > activeStepIndex) {
+ // Can we skip to this step? (all steps between current and this one are optional)
51
+ if (canSkip(activeStepIndex + 1, index, steps)) {
52
+ return StepStatusValues.Next;
53
+ }
54
+ // Immediate next step is also navigable if it's optional
55
+ if (index === activeStepIndex + 1 && steps[index]?.isOptional) {
56
57
58
59
return StepStatusValues.Unvisited;
60
0 commit comments