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

isEmpty also true when selected == 0 #687

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
ctrl.$filter = $filter;

ctrl.isEmpty = function() {
return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '';
return angular.isUndefined(ctrl.selected) || ctrl.selected === null || ctrl.selected === '' || ctrl.selected === 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this will be ok since 0 could be a value, so it isn't actually empty. This function will make the placeholder appear even when the user selects 0as value

Copy link
Author

Choose a reason for hiding this comment

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

I understand. Thanks. Probably not an issue anymore when #302 is implemented.

};

var _searchInput = $element.querySelectorAll('input.ui-select-search');
Expand Down