title: Global location input autocomplete
body: <p>I was looking for a plugin to create a smart location form field which has a suggested autocomplete. I was unable to find anything suitable (Google Geocode is too unreliable on its own, and it isn't designed for this) so I built my own. I thought it was crazy that in 2011 an open-source global location input plugin like this didn't exist so set out to give it a go.</p>
  
  <p>The demo is here <a href="http://labs.unxposed.net/unxposed/geocode/" rel="nofollow noreferrer">http://labs.unxposed.net/unxposed/geocode/</a> and is working on Chrome and Firefox 4. Download is here <a href="https://github.com/unxposed/geocode" rel="nofollow noreferrer">https://github.com/unxposed/geocode</a></p>
  
  <p>There is one major issue I am having with it. Sometimes it works great like so. On typing <strong>Ban</strong> in the input I get a list of suggestions back. The input is autofilled with the first suggestion back matching <strong>Ban</strong> and the input text after <strong>Ban</strong> is selected (much like the Chrome address bar).</p>
  
  <p><img src="https://i.stack.imgur.com/zWBcd.jpg" alt="enter image description here"></p>
  
  <p>However, much of the time the autofill selected text in the input becomes unhighlighted and the cursor then moves to the end of the input (which is really annoying). Like so - after I type <strong>Banbur</strong>.</p>
  
  <p><img src="https://i.stack.imgur.com/wCiPz.jpg" alt="enter image description here"></p>
  
  <p>I am pretty sure this is related to Google Maps as if I remove the secondary source (Google Geocode) the issue is resolved and autofill/input select works great consistently, but why is this happening, and how can I fix it?</p>
  
  <p>Any other improvements/optimisations/suggestions would be greatly appreciated too!</p>
  
  <p>Thanks</p>