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

[Selectize] Input box is not hidden when selected data is 0 (as number) #1304

Closed
phabdev opened this issue Nov 13, 2015 · 2 comments
Closed

Comments

@phabdev
Copy link

phabdev commented Nov 13, 2015

When selectize theme is used, if the selected data is 0 (as number) input box is not hidden and the bar is not well shown.
I noticed that the criterion to hide the input box is

ng-hide="!$select.searchEnabled || ($select.selected && !$select.open)"

It should be: "hide it if search is disabled or hide it if something is selected and the box is closed", but it doesn't work if $select.selected is 0 (as 0 is false in javascript).
So i think that is should be something like

ng-hide="!$select.searchEnabled || (($select.selected || $select.selected===0) && !$select.open)"

I tried only with selectize theme. Didn't check if it is handled with other themes.

@wesleycho
Copy link
Contributor

Can you open a PR with this change?

@Jefiozie
Copy link
Contributor

Added this fix.

user378230 pushed a commit that referenced this issue Jul 8, 2016
Previous check was only for a falsy value rather than null or undefined
causing input box not to be hidden even though an item had been selected.
(As that item's value evaluated to fals-y) 

Update check to ensure falsy-values actually register as being selected.

Closes #1304
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants