Skip to content

Conversation

@zhuminghui17
Copy link
Contributor

What does this PR do?

Improves the client name validation UX by only showing validation errors after user interaction with the field. This builds on PR #160 by addressing the initial error state that could confuse users.

Changes made:

  • Added isNameTouched state to track field interaction
  • Modified validation logic to only show errors after field interaction
  • Added onBlur handler to detect when user leaves the name input field
  • Maintains required field validation while providing better user feedback timing
  • Marks client name field as required with * in ClientFormSection

How to test

Open the client creation form

  1. Verify the name field starts with no error state
  2. Click into the name field and then click away (blur) - should show error
  3. Type a name and verify error disappears
  4. Delete the name and click away - should show error again
  5. Verify the form still requires a name to be submitted

Copy link
Collaborator

@matteo8p matteo8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't even think of this issue, so thank you for doing this!

@matteo8p matteo8p merged commit d80f512 into main Jul 4, 2025
2 checks passed
@matteo8p matteo8p deleted the delayed-client-name-validation branch July 4, 2025 04:30
khandrew1 pushed a commit that referenced this pull request Nov 15, 2025
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