codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
24 stars 23 forks source link

[Bug Report] - Add Contact Validation #614

Closed leekahung closed 2 months ago

leekahung commented 2 months ago

Describe the bug:

Currently, validation for the Add Contact modal seems to be broken (see screenshot below). When clicking on "Add Contact", without the username for the new contact to be added, it breaks down and get stuck on the modal with the function for onSubmit getting triggered.

While users can escape with the cancel button or ESC key, the "Add Contact" button is no longer accessible.

Expected behavior:

Form validation requires users to have a valid username before it can submit the form for "Add Contact".

Screenshots:

Screenshot 2024-04-16 at 6 30 46 PM

To Reproduce:

Steps to reproduce the behavior:

  1. Go to Contacts
  2. Click on "Add Contacts"
  3. Insert information only in the optional fields
  4. Click on "Add Contact" button
  5. See error

Possible Fix:

Include validation as part of the input field for username.

JaeGif commented 2 months ago

Do we want the other fields not labeled "optional" to be mandatory?

leekahung commented 2 months ago

Yeah, it would be good to keep fields that are not optional as required fields for submission.