savvato-software / dtim-mobile

The application we use to interact with people during a tech interview meeting.
1 stars 3 forks source link

changed error messages #19

Closed braydenc303 closed 4 years ago

haxwell commented 4 years ago

I updated issue #1 with a bit more detail about the steps to reproduce, and the expected vs actual behavior.

braydenc303 commented 4 years ago

Also updated the placeholder and messages for the phone field.

haxwell commented 4 years ago

SO close!

Thanks for changing the placeholder text in the phone number field, too.

The problem I am seeing is that it is validating the text, in both the email and phone fields, before the user exits the field.

To reproduce,

  1. Click I Am New Here.
  2. Enter valid name
  3. Enter a single character in the email OR phone field.

Actual: We see the error message, telling us the value of the field is not valid. Expected: As the user is typing in the field, there should be no error message. That should only appear once the user has left the field.

braydenc303 commented 4 years ago

I have validation happening on blur now. I do not know how to accomplish the second bullet point:

either onBlur or onChange. The error message that is present upon the previous onBlur stays in place until the next onBlur where it is either valid, or has the same, or a different error message.

The only other option that I see here is to have validation onChange as is the default, that way, as soon as there is a valid value, or the field is cleared, the error message is cleared. Personally, this is the behavior that I prefer. That way, there is an error message present whenever the field is invalid, and it explains why the submit button is not active.

haxwell commented 4 years ago

I am smiling ear to ear!

That's awesome, yes, I went through all the cases I could think of and there it is.. The code handles all of them. Nice.

I will merge this to the main Dev branch.

There are a few more polishes I can think of, and then we can merge it into Master.

haxwell commented 4 years ago

Actually, now that I'm looking at it, only one polish: Remove the comments at the end of the file.

haxwell commented 4 years ago

And the Cypress tests.