diff --git a/jquery.geocomplete.js b/jquery.geocomplete.js index 35fe1c4..80284a8 100644 --- a/jquery.geocomplete.js +++ b/jquery.geocomplete.js @@ -366,13 +366,13 @@ } // Get the first suggestion's text. - var $span1 = $(".pac-container:visible .pac-item" + selected + ":first span:nth-child(2)").text(); - var $span2 = $(".pac-container:visible .pac-item" + selected + ":first span:nth-child(3)").text(); + var $span1 = $(".pac-container .pac-item" + selected + ":first .pac-item-query").text(); + var $span2 = $(".pac-container .pac-item" + selected + ":first span:nth-child(3)").text(); // Adds the additional information, if available. var firstResult = $span1; if ($span2) { - firstResult += " - " + $span2; + firstResult += ", " + $span2; } this.$input.val(firstResult);