title: Trigger Google Places Autocomplete
body: <p>I am trying to attach a virtual keyboard to bind to a Google places autocomplete input.</p>
  
  <p>If I physically type in a letter in the input, a Google-powered dropdown displays the autocomplete predictions based on where the map is centered. If I click on a virtual keyboard key, the input gets updated properly, but the autocomplete predictions are not updated.</p>
  
  <p>I have tried to use the virtual keyboard <code>change</code> callback to trigger a "keyup" (stackoverflow results), "keypress", "keydown", "change" and I even tried this (<a href="http://jsbin.com/nojuy/3/edit?html,output">demo</a>):</p>
  
  <pre><code>change : function(e, keyboard, el) {
      google.maps.event.trigger(autocomplete, 'place_changed');
  }
  </code></pre>
  
  <p>which results in a javascript error basically showing that <code>autocomplete.getPlace();</code> does not return a result.</p>
  
  <p>So now I've tried the code below (in <a href="http://jsbin.com/nehobale/2/edit?html,output">this demo</a>), which uses the change callback to trigger an autocomplete prediction, but as you can see in that demo, the results differ. </p>
  
  <pre><code>change : function(e, keyboard, el) {
    var $el = $(el),
        service = new google.maps.places.AutocompleteService();
    if ($el.val() !== "") {
      service.getQueryPredictions({ input: $(el).val() }, function(predictions, status) {
        if (status != google.maps.places.PlacesServiceStatus.OK) {
          alert(status);
          return;
        }
        var list = '', $results = $('#results');
        for (var i = 0, prediction; prediction = predictions[i]; i++) {
          list += '&lt;li&gt;' + prediction.description + '&lt;/li&gt;';
        }
        $results.html(list);
      });
    }
  }
  </code></pre>
  
  <p>Ideally, I want to trigger the already established autocomplete prediction dropdown to update while typing on the virtual keyboard.</p>