fix: revalidate confirmPassword field on password change #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#68 closed
Description
This PR fixes an issue where the Confirm Password field remained valid even after the Password value was modified.
The root cause was that the confirm field’s validation was not re-triggered when the main password changed.
This update refactors the validation logic to ensure cross-field revalidation between both inputs, and improves accessibility with more accurate ARIA usage.
Changes
Cross-field validation (major fix)
confirmPasswordis now a controlled input (stringstate).isMatch) is derived withuseMemoand automatically re-evaluates whenever either field changes.Accessibility improvement
aria-invalidto only activate when the user has entered input and passwords do not match.UI feedback
Cleanup
!confirmPassword && confirmPassword).Motivation
Previously, the confirm-password input would stay in a “valid” state even after the password changed, breaking expected UX behavior.
This fix ensures immediate revalidation and a more consistent, accessible user experience when handling password confirmation flows.
Breaking Changes
stringstate + derived validation rather than abooleanstate.