{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/typeahead.js/issues/1344","repository_url":"https://api.github.com/repos/twitter/typeahead.js","labels_url":"https://api.github.com/repos/twitter/typeahead.js/issues/1344/labels{/name}","comments_url":"https://api.github.com/repos/twitter/typeahead.js/issues/1344/comments","events_url":"https://api.github.com/repos/twitter/typeahead.js/issues/1344/events","html_url":"https://github.com/twitter/typeahead.js/issues/1344","id":99921980,"number":1344,"title":"Unnecessary AJAX request sent on hint autocomplete","user":{"login":"bitcity","id":4221404,"avatar_url":"https://avatars.githubusercontent.com/u/4221404?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcity","html_url":"https://github.com/bitcity","followers_url":"https://api.github.com/users/bitcity/followers","following_url":"https://api.github.com/users/bitcity/following{/other_user}","gists_url":"https://api.github.com/users/bitcity/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcity/subscriptions","organizations_url":"https://api.github.com/users/bitcity/orgs","repos_url":"https://api.github.com/users/bitcity/repos","events_url":"https://api.github.com/users/bitcity/events{/privacy}","received_events_url":"https://api.github.com/users/bitcity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-09T19:37:56Z","updated_at":"2016-02-26T10:57:45Z","closed_at":null,"body":"In this example : http://twitter.github.io/typeahead.js/examples/#remote\r\n\r\nIf I type `Chi`, there's 1 network request and I see 1 suggestion i.e. `Chicago`. Now if I hit <kbd>→</kbd> or <kbd>Tab</kbd> key to autocomplete the hint, there's another network request sent for `Chicago`. How can I avoid this ? \r\n\r\nProbably related to #188 & #548\r\n\r\n( I'll add that the reason isn't just to save on network requests. I have an app that dynamically updates the request URL and I want a better control over which requests are sent. In the above case, an automatic request is sent using a stale URL )\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/twitter/typeahead.js/issues/comments/189221291","html_url":"https://github.com/twitter/typeahead.js/issues/1344#issuecomment-189221291","issue_url":"https://api.github.com/repos/twitter/typeahead.js/issues/1344","id":189221291,"user":{"login":"andre-rafa-b","id":15729031,"avatar_url":"https://avatars.githubusercontent.com/u/15729031?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-rafa-b","html_url":"https://github.com/andre-rafa-b","followers_url":"https://api.github.com/users/andre-rafa-b/followers","following_url":"https://api.github.com/users/andre-rafa-b/following{/other_user}","gists_url":"https://api.github.com/users/andre-rafa-b/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-rafa-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-rafa-b/subscriptions","organizations_url":"https://api.github.com/users/andre-rafa-b/orgs","repos_url":"https://api.github.com/users/andre-rafa-b/repos","events_url":"https://api.github.com/users/andre-rafa-b/events{/privacy}","received_events_url":"https://api.github.com/users/andre-rafa-b/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T10:57:45Z","updated_at":"2016-02-26T10:57:45Z","body":"I used the MatthewReed solution but it didn't revolve my problem. Then I change it a little:\r\nI didn't comment the line below. Instead of that I passed a second parameter called silent as true.\r\n`this.input.setQuery(data.val, true); `\r\nIt isn't ready yet. The follow lines are also necessary:\r\n`this.menu.update(query);  \r\nthis.close(); `\r\n\r\nIt solved the autocomplete event problem but it still occurs when the input field got focused. I will try to fix it another time. For now it fits me."}}