Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Bug/required multiple select #1025

Conversation

jcolemorrison
Copy link

Closes the following:

#850

and

#914

The fix adds a custom validator to multiple selects that enables the required tag. Custom validators are not "my" own customized way of doing things, they are the official angular way of writing validators as outlined in the Custom Validators section here https://docs.angularjs.org/guide/forms

The problem was that required checks the ngModel's viewModel, which when empty on a ui-select-multiple is an empty array...which is technically not empty. Now it checks properly without interfering with the standard required validator.

Also fixed a test bug where $item.name wasn't being used in the multiple example.

Fixed Git ignore file
@guidoffm
Copy link

I have found this problem: When I also have the ng-change attribute pointing to a function and when I remove the last element from the multiple selection then the model is set to undefined.

@user378230
Copy link
Contributor

I believe #1492 fixes this and has been merged, so closing. If you disagree please let us know.

@user378230 user378230 closed this Mar 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants