Make Enter and clicking outside input field autocomplete