You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
For input[type=date] and input[type=month] (at least, that's all I've checked), in Chrome. If the required attribute is present, the ngModelController initially has the required error, which is expected. However, once a value is entered with the native date/month picker and subsequently cleared with the backspace key, only the month or date error is present.
Looking through the source is a bit confusing. There are comments in badInputChecker about email input types, but badInputChecker is not applied to input[type=email]. Maybe it was at one time.
To make things even more interesting, input[type=number] does not exhibit this behavior. Once the input is cleared, the validity.badInput property is set to false, whereas with the date inputs it is not. Is badInputChecker really doing us any good at this point?
Additionally, the native Chrome validator (which runs when the submit button is clicked) works correctly. A partially entered date or month will trigger a "Please enter a valid value." message whereas once it has been completely cleared Chrome says "Please fill out this field", even though in both cases the validity badInput property is true (once a date has been selected and then cleared).
Maybe this is just a browser bug.
The text was updated successfully, but these errors were encountered:
When you have picked a date, and then clear either year / month / day, the browser will fire an input event. When you clear the remaining fields, the event is not fired. This might be because after you clear the first field, the input value is already empty.
This could possibly remedied with listening to keydown, too.
We actually fixed this a while back. After clearing the input, the date / month error will disappear and required will return (as the input is now "empty" again).
For
input[type=date]
andinput[type=month]
(at least, that's all I've checked), in Chrome. If therequired
attribute is present, the ngModelController initially has therequired
error, which is expected. However, once a value is entered with the native date/month picker and subsequently cleared with the backspace key, only themonth
ordate
error is present.http://plnkr.co/edit/ze5bGClVLjQkNVNxnkc2?p=preview
Looking through the source is a bit confusing. There are comments in
badInputChecker
about email input types, butbadInputChecker
is not applied toinput[type=email]
. Maybe it was at one time.To make things even more interesting,
input[type=number]
does not exhibit this behavior. Once the input is cleared, thevalidity.badInput
property is set to false, whereas with the date inputs it is not. IsbadInputChecker
really doing us any good at this point?Additionally, the native Chrome validator (which runs when the submit button is clicked) works correctly. A partially entered date or month will trigger a "Please enter a valid value." message whereas once it has been completely cleared Chrome says "Please fill out this field", even though in both cases the validity
badInput
property is true (once a date has been selected and then cleared).Maybe this is just a browser bug.
The text was updated successfully, but these errors were encountered: