Primeng: Error in Calendar when validating input value

Created on 10 Jul 2017  Â·  4Comments  Â·  Source: primefaces/primeng

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
http://plnkr.co/edit/3GPKSVCNUdx7XOkap2dt

Current behavior
If you type some invalid date value directly, validation does it job, says date is not valid and text you introduced is kept in the input box of the calendar. However, if you select a valid date using calendar dropdown, and for example, remove two digits of the date (creating an invalid date), validation works, but text in the input box disappears. This behavior is not consistent with the one described before and also confuses the end user, because invalid date message is shown, but no text is on the input field.

Expected behavior
Text in the input box does not disappear after introducing a valid date and removing 2 digits for example. So if an invalid value is introduced, it is kept so user understands what is wrong.

Minimal reproduction of the problem with instructions
Follow the instructions in "Current behavior" in provided Plunkr

What is the motivation / use case for changing the behavior?
It is an inconsistent behavior and confuses end user.

Please tell us about your environment:
Windows 7

  • Angular version: 2.0.X and 4.0.X

  • PrimeNG version: 2.0.X and 4.0.X

  • Browser: Chrome 59

Most helpful comment

I would be very keen to see an option to keepInvalidDate for example. I would feel this results in a better user experience for our particular use case.

All 4 comments

Manual input is also cleared in my case so behavior seems consistent to me. If more users demand this, we'll reopen. Also this should be an option like keepInvalidDate or so.

It is only cleared after you introduce a valid date first. If you add the
first time an invalid date (aaaaa, e.g.), it will not clear. Anyways IMHO,
it is not consistent since the field is cleared, but the calendar stays in
invalid state when you use built in validator. So user will see a message
saying that the date is invalid, but there is not date in the field.

2017-07-19 9:54 GMT+02:00 Çağatay Çivici notifications@github.com:

Manual input is also cleared in my case so behavior seems consistent to
me. If more users demand this, we'll reopen. Also this should be an option
like keepInvalidDate or so.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/primefaces/primeng/issues/3338#issuecomment-316302960,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AaqGDoedagX_GDMYMnQGqFgFTZlRk46Uks5sPbZDgaJpZM4OS4G1
.

I would be very keen to see an option to keepInvalidDate for example. I would feel this results in a better user experience for our particular use case.

Id like the option to retain invalid input for the date picker, thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mitosandov picture mitosandov  Â·  3Comments

SchneMa picture SchneMa  Â·  3Comments

just-paja picture just-paja  Â·  3Comments

Helayxa picture Helayxa  Â·  3Comments

miresk picture miresk  Â·  3Comments