angular-google-places-autocomplete
angular-google-places-autocomplete copied to clipboard
Text Clipping
In some instances on place selection the address is clipped. Seems to only happen to the numbers in the address. Any idea where this is coming from? See below for a before and after click/selection event.
i think, before you click something, predictions object get terms of address. final address is formatted address, it's different from prediction address. so if you want manipulate some address for view input box, i think you change formatted address and find data in prediction object.
@YooJaSung is right and it sucks. It's a common problem with the formatted address of place details not matching the prediction text. If anyone has a suggestion about how to better match the prediction to the address then I'd love to hear it.
I addressed this by mapping "viewValue" in the "format" function to modelValue.name instead of modelValue.formatted_address.
+1. the formatting of the prediction address should be the same formatting once it's selected
@ankitg06 thanks for the comment - can you reference where in the code you made this update?
Here's the block:
function format(modelValue) {
var viewValue = "";
if (isString(modelValue)) {
viewValue = modelValue;
} else if (isObject(modelValue)) {
viewValue = attrs.nameAsViewResult ? modelValue.name : modelValue.formatted_address; // AG: Fix for predictions text not matching result text
}
return viewValue;
}