Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Allow null option #91

Merged
merged 2 commits into from
Dec 17, 2015
Merged

Conversation

KorinaGraber
Copy link
Contributor

Added support for specifying a null option for the select dropdown. When a null option is specified, add a config object to the start of the options array. The code will recognize this object and use the nullOption string as its display name, and set ngModel to null when it's selected. This isn't a pretty solution, but it's the only thing I could come up with due to the fact that ui-select doesn't support null-options yet.

Per angular-ui/ui-select#302, null options aren't supported in ui-select yet.

TODO: Add unit tests for the select component. This could come in a later PR. I tested this feature visually to make sure that it worked.

SamGraber added 2 commits December 16, 2015 16:55
…hen a null option is specified, add a config object to the start of the options array. The code will recognize this object and use the nullOption string as its display name, and set ngModel to null when it's selected. This isn't a pretty solution, but it's the only thing I could come up with due to the fact that ui-select doesn't support null-options yet.
@SonofNun15
Copy link
Contributor

ui-select doesn't support null options? That seems kind of lame.

@SonofNun15
Copy link
Contributor

Does Select2? I thought ui-select was based on Select2?

SonofNun15 pushed a commit that referenced this pull request Dec 17, 2015
@SonofNun15 SonofNun15 merged commit f98826d into RenovoSolutions:master Dec 17, 2015
@SonofNun15 SonofNun15 deleted the allow_null_option branch December 17, 2015 19:36
@KorinaGraber
Copy link
Contributor Author

As per the linked issue, they're thinking of adding support, but haven't yet. I don't know about Select2

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.

2 participants