digitalfabrik / entitlementcard

App for 'Digitale Berechtigungskarten', generally benefit card for volunteers or socially vulnerable groups in Germany. App for Android & iOS + Backend + Administration Web Portal – 100% Open Source.
MIT License
36 stars 3 forks source link

1664: Untouched State #1771

Closed f1sh1918 closed 6 days ago

f1sh1918 commented 1 week ago

Short description

As a user i don't want to get initial error message if i did not interact with the form

Proposed changes

Side effects

Testing

  1. Open /erstellen
  2. No error messages should be shown initially to the user
  3. Click "Koblenz Pass erstellen" without filling anything or not filling all required fields. All fields should be validated and show error messages
  4. Test if all fields still will be validated correctly

Resolved issues

Fixes: #1664

f1sh1918 commented 1 week ago

Personally, I think errors should only be shown once the user leaves the field (or the send button is clicked). Otherwise it always feels a little aggressive if I type the first letter of my name and already get an error message. Not sure if that is easily possible though. This would also mitigate the issue that onChange is not called if just leaving the field again without any input.

Do you plan to implement this for the other extensions/expiration date for the other passes/cards as well?

Otherwise works as expected, nice work.

Puh sorry for this "dirty" pr I see your point that it looks aggressive. I set touched onBlur but this has also one drawback which is maybe okay. If you type in sth and make an issue you won't get a feedback immediately. You have to leave input field to get error and you have to jump back. But thats maybe the expected behavior though, so thx for the hint

And yes we may also implement untouched state and error hints for the other extensions in a separate ticket #1780