Skip to content

Fix required field error and retain previous inputs for validation failures in accept invite component#407

Merged
thiva-k merged 2 commits intoasgardeo:mainfrom
thiva-k:update-invite-accept
Mar 18, 2026
Merged

Fix required field error and retain previous inputs for validation failures in accept invite component#407
thiva-k merged 2 commits intoasgardeo:mainfrom
thiva-k:update-invite-accept

Conversation

@thiva-k
Copy link
Contributor

@thiva-k thiva-k commented Mar 18, 2026

This pull request makes several improvements to the BaseAcceptInvite component, primarily focusing on form validation, error messaging, and code simplification. The changes enhance user feedback for required fields, improve form state management, and simplify how form components are rendered.

Screen.Recording.2026-03-18.at.11.56.13.mov

Form validation and error handling improvements:

  • Updated required field validation to use a translation key (t('validations.required.field.error')) for error messages, enabling localization and consistency in user feedback.
  • Changed the validation function to depend on the translation function t, ensuring error messages are updated if the language changes.
  • Improved the order of state updates when validation fails, setting isFormValid before updating error states for better UI consistency.
  • Set isFormValid to true when errors are cleared, ensuring the form is marked as valid only when appropriate.
  • Removed redundant setting of isFormValid to true on submit, relying on validation logic instead.

Form state management:

  • On flow update, reset form errors and touched fields but preserve input values, so users don't lose their data when the flow changes.

Code simplification:

  • Removed the renderComponents callback and now directly call renderInviteUserComponents in the render method, reducing indirection and making the code easier to follow. [1] [2]

@asgardeo-github-bot
Copy link

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

@thiva-k thiva-k merged commit 93fa377 into asgardeo:main Mar 18, 2026
6 of 8 checks passed
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.

3 participants