Open gschoppe opened 10 years ago
I am also seeing this. I was able to track it down to the this.find() call on line 195 (inside the bind of the blur event). I replaced that call with code from the placeChanged method (around line 456), that adds the selectFirstResult() return as a parameter for find. The end result looked like this:
if (this.options.blur === true){
this.$input.blur($.proxy(function(){
//this.find();
var autoSelection = this.selectFirstResult();
this.find(autoSelection);
}, this));
}
This seems to be working for my purposes, but more testing may be needed.
This solution works for me as well. Thanks!
I've been seeing this too. Thanks for the tip.
This doesn't seem applicable to the current version - there's no difference between this hack and setting blur
to false. I definitely experience this issue though.
It's really frustrating because it grabs results from other countries and I want to limit to USA results...
To my knowledge there IS difference. If 'blur' is false, the 'blur' event is not bound on the input filed.
I've used the snippet from seanbfuller commented on Apr 28, 2014 and I've set blur: true, geocodeAfterResult: false, restoreValueAfterBlur: true So far it yields results I wanted, I've removed the find button, and I'm trying to restrict the input to always have a valid city. So when user blur, then auto-select the first selection.
I am using the following code to initialize my geocomplete:
the expected result is that once I leave the form, triggering blur, it is geocoded to my preferences. The actual result is that the "auto-geocoding" happens when I choose an address from the dropdown, or whenever I leave the textfield, and overrides the existing, good geocoding result with one selected without regards to my country limitation.
For example, if I enter "18", the first dropdown choice is
1838 Spaulding Rd, St Johnsbury, VT 05819
. However, when I click it, My address changes to18, Denmark
(despite the country bound i set), and that address is shown on the map.This same incorrect geocoding happens if I click outside the box or tab away after entering data.