Skip to content

Added async step validation#15

Merged
ignsm merged 8 commits intomainfrom
feat/async-step-validation
Apr 10, 2026
Merged

Added async step validation#15
ignsm merged 8 commits intomainfrom
feat/async-step-validation

Conversation

@ignsm
Copy link
Copy Markdown
Owner

@ignsm ignsm commented Apr 9, 2026

Summary

  • Add onStepValidate callback: async validation that runs between steps,
    after sync validation passes, but before the transition. Enables server-side
    checks without the visual glitch of advancing and snapping back.
  • New nextStepAsync() method on FormEngine, stepValidating state property.
  • Wired through both React and Vue adapters: "Continue" button shows loading
    state automatically during async validation.

ignsm added 7 commits April 9, 2026 22:36
Add StepValidateFn type, onStepValidate option, stepValidating state,
and nextStepAsync() method. Enables server-side validation between
steps without UX glitches. Includes try/finally for exception safety,
stale-step guard, and smart error routing to topLevelErrors.
Pass onStepValidate into engine options, make handleNext/onNext async
via nextStepAsync(), merge stepValidating into loading state for the
Continue button. Add stepValidating to Vue composable return type.
Add 13 tests for nextStepAsync covering sync fallback, error blocking,
concurrent call rejection, exception recovery, stale-step discard,
and topLevelErrors routing. Update React multi-step tests to use
waitFor for async handleNext.
Add onStepValidate section to steps guide with React/Vue examples,
update validation timing docs, add async error handling section,
and document StepValidateFn type and stepValidating property in
API reference.
Reset stepValidating before _notify() in each exit path instead of
using a finally block. Reduces re-renders from 2 to 1 per step advance.
Reset errors and topLevelErrors before processing onStepValidate
return value. Prevents stale errors from previous attempts
accumulating across retries.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
formhaus Ready Ready Preview, Comment Apr 9, 2026 2:07pm

@ignsm ignsm merged commit 4afdc17 into main Apr 10, 2026
3 checks passed
@ignsm ignsm deleted the feat/async-step-validation branch April 10, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant