{"action":"opened","issue":{"url":"https://api.github.com/repos/theCrag/website/issues/1836","labels_url":"https://api.github.com/repos/theCrag/website/issues/1836/labels{/name}","comments_url":"https://api.github.com/repos/theCrag/website/issues/1836/comments","events_url":"https://api.github.com/repos/theCrag/website/issues/1836/events","html_url":"https://github.com/theCrag/website/issues/1836","id":55442033,"number":1836,"title":"Select2 keyboard selection bug when new data arrives, selection is discarded","user":{"login":"brendanheywood","id":187449,"avatar_url":"https://avatars.githubusercontent.com/u/187449?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanheywood","html_url":"https://github.com/brendanheywood","followers_url":"https://api.github.com/users/brendanheywood/followers","following_url":"https://api.github.com/users/brendanheywood/following{/other_user}","gists_url":"https://api.github.com/users/brendanheywood/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanheywood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanheywood/subscriptions","organizations_url":"https://api.github.com/users/brendanheywood/orgs","repos_url":"https://api.github.com/users/brendanheywood/repos","events_url":"https://api.github.com/users/brendanheywood/events{/privacy}","received_events_url":"https://api.github.com/users/brendanheywood/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/theCrag/website/labels/2:%20Bug%20fix","name":"2: Bug fix","color":"ff0000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-26T02:49:59Z","updated_at":"2015-01-26T02:49:59Z","closed_at":null,"body":"A subtle but shitty bug.\r\n\r\nLet's say I search for 'wil' and Will Monks pops up along with a bunch of other results. Let say this set of results was from the 'wi' and the 'wil' query is still in transit over the network. I see Will, press down to select him, and then press enter. In the mean time the 'wil' request has come back, the results whilest smaller and still mostly the same, and importantly the ```@willmonks``` suggestion is in both, but when the second set of results is injected by keyboard selection is discard, so depending on the timing when I hit enter the selection is now back on 'wil' instead of '@willmonks'\r\n\r\n* [ ] Should be fairly easy to fix, whenever new data is injected read the selection state and if that row is also in the new results then re-select it.\r\n* [ ] There could be a trickier use case where the selection you had is no longer around, I think we can ignore this and just reset it like it is now\r\n\r\n\r\n"}}