Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngOptions): allow empty option selection with multiple attribute #12541

Conversation

arm1n
Copy link
Contributor

@arm1n arm1n commented Aug 10, 2015

fixes #12511

@Narretz
Copy link
Contributor

Narretz commented Aug 10, 2015

Hi @arm1n thanks for the PR! It looks good. I just wondered: did you upgrade your app to 1.4.x? I noticed that the behavior is different in 1.3.x and before, because the empty option is never displayed for multi selects (because you can deselect until the selection is empty).
I just wanted to get your opinion - if you consider displaying the empty option at all "correct".

@Narretz Narretz self-assigned this Aug 10, 2015
@Narretz Narretz added this to the 1.4.5 milestone Aug 10, 2015
@arm1n
Copy link
Contributor Author

arm1n commented Aug 10, 2015

Hi @Narretz! I admit that it's quite rare to use empty options for <select> with multiple attribute. Nevertheless, I think it should be up to the developer to make use of it or not, this seems to be a matter of preference. To be consistent and meet assumed user expectations, it should behave the same way as if multiple is absent, but I don't think it should be selected by default, which is already reflected by current behavior, but it simply doesn't reset ng-model caused by type error. This would be fixed by this pull request.

As I started building my app from 1.4.1 and recently updated to 1.4.3 I cannot tell you, if this would irritate an updating user. But if nobody ever complained, it's a really rare use case and maybe nobody has any expectations about such behavior, what do you think?

@Narretz
Copy link
Contributor

Narretz commented Aug 11, 2015

@arm1n I agree, it makes the most sense to have the option for an empty option whether the select is multiple or not. Thanks for the PR!

@Narretz Narretz closed this in c11a7d6 Aug 11, 2015
Narretz pushed a commit to Narretz/angular.js that referenced this pull request Aug 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngOptions.js throws type error when selecting empty value and using 'multiple' on select
3 participants