Fix autocomplete bug

Clicking on a result would sometimes cause the search to kick off
without auto completing first.