Hide search box if select is empty

Fix #2282.
When a select box is empty (this appends in my case, I have a dynamic select box), the search box should not be shown.