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

fix(Selectize): Input box is not hidden when selected data is 0 (as n… #1691

Merged
merged 3 commits into from
Jul 8, 2016

Conversation

Jefiozie
Copy link
Contributor

…umber)

Closes #1304

@user378230
Copy link
Contributor

user378230 commented Jul 5, 2016

@Jefiozie Wouldn't it be better to check $select.selected !== undefined && $select.selected !== null?

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Jul 6, 2016

@user378230, i think you are right. Maybe it is even better to use the isEmpty function?

ctrl.isEmpty = function() { return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '' || (ctrl.multiple && ctrl.selected.length === 0); };

@user378230
Copy link
Contributor

Yes, good spot!

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Jul 6, 2016

@user378230 okay will change it later today.

@Jefiozie
Copy link
Contributor Author

Jefiozie commented Jul 6, 2016

@user378230, changed the code as discussed in the comments above.

@@ -8,7 +8,7 @@
ng-click="$select.toggle($event)"
placeholder="{{$select.placeholder}}"
ng-model="$select.search"
ng-hide="!$select.searchEnabled || ($select.selected && !$select.open)"
ng-hide="!$select.searchEnabled || (($select.selected || !$select.isEmpty()) && !$select.open)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we can remove $select.selected now...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can 😄

@user378230 user378230 merged commit e179dc6 into angular-ui:master Jul 8, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants