Hide/show elements correctly when search is empty

This fixes:
1. Hiding the placeholder when there's input in the search box
2. Hiding the cancel/clear button when the search box is empty

This includes the changes of #134 as both relies on the same check if the search box is truly empty and #134 is yet to be merged.