@papernote/ui 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FormWizard.d.ts.map +1 -1
- package/dist/index.esm.js +42 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +42 -48
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FormWizard.tsx +6 -4
package/package.json
CHANGED
|
@@ -34,7 +34,6 @@ export default function FormWizard({
|
|
|
34
34
|
|
|
35
35
|
const isFirstStep = currentStep === 0;
|
|
36
36
|
const isLastStep = currentStep === steps.length - 1;
|
|
37
|
-
const canGoNext = allowSkip || completedSteps.has(currentStep);
|
|
38
37
|
|
|
39
38
|
// Go to specific step
|
|
40
39
|
const goToStep = (stepIndex: number) => {
|
|
@@ -69,8 +68,11 @@ export default function FormWizard({
|
|
|
69
68
|
setIsSubmitting(false);
|
|
70
69
|
}
|
|
71
70
|
} else {
|
|
72
|
-
//
|
|
73
|
-
|
|
71
|
+
// Advance to next step directly (don't use goToStep which checks completedSteps
|
|
72
|
+
// before React has re-rendered with the updated state)
|
|
73
|
+
const nextStepIndex = currentStep + 1;
|
|
74
|
+
setCurrentStep(nextStepIndex);
|
|
75
|
+
onStepChange?.(nextStepIndex);
|
|
74
76
|
}
|
|
75
77
|
};
|
|
76
78
|
|
|
@@ -191,7 +193,7 @@ export default function FormWizard({
|
|
|
191
193
|
<button
|
|
192
194
|
type="button"
|
|
193
195
|
onClick={nextStep}
|
|
194
|
-
disabled={
|
|
196
|
+
disabled={isSubmitting}
|
|
195
197
|
className="px-4 py-2 text-sm font-medium text-white bg-accent-500 rounded-lg hover:bg-accent-600 disabled:opacity-40 disabled:cursor-not-allowed transition-all"
|
|
196
198
|
>
|
|
197
199
|
{isSubmitting ? 'Submitting...' : isLastStep ? 'Complete' : 'Next'}
|