Fixed bug when autocomplete list  does not disappear when other element is clicked