-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(select): ngRequired invalidate when modelValue is empty array #5337
Conversation
Thanks for the PR!
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let me know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
|
||
scope.$apply(function() { | ||
// ngModelWatch does not set objectEquality flag | ||
// array must be replaced in order to trigger $formatters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this little jig be turned into a separate bug? Perhaps ngModelController could compare value.length
to the old length (and try not to break in the case of scalars, of course) --- to avert this somewhat. Or perhaps just use the objectEquality flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should open a new bug for that. See #5449
@IgorMinar I know that these are automated messages, however I did just sign again today just in case the old signature really did vanish. It is signed as |
When `multiple` attribute is set, and the model value is an empty array, invalidate the form control.
@caitp the email addresses don't match. look at the email at https://github.com/angular/angular.js/pull/5337.patch it's different from the one in the spreadsheet. and yes, the comments are automated so it will keep on bugging you until you sign the CLA with the right email or change all pull requests to use the other email (the former is less hassle). sorry about the spam, but given how many PRs we deal with, we are automating as much as we can and sometimes it results in "spammy" behavior. we are trying hard to avoid it as much as possible. |
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
Yeah as I said in matsko's patch, I understand why it's being done, so of course there is no need for apologies :) I didn't realize the email address was being used rather than the author name, however. Anyways, re-signed with the legacy email address, cheers. |
When `multiple` attribute is set on a `<select>` control and the model value is an empty array, we should invalidate the control. Previously, this directive was using incorrect logic for determining if the model was empty. Closes angular#5337
When `multiple` attribute is set on a `<select>` control and the model value is an empty array, we should invalidate the control. Previously, this directive was using incorrect logic for determining if the model was empty. Closes angular#5337
When
multiple
attribute is set, and the model value is an empty array, invalidate the form control.TODO: ngModelWatch should probably do a bit more work to see if the model value is equal or not. (see comment in selectSpec.js)
Fixes #2365