angular-google-places-autocomplete icon indicating copy to clipboard operation
angular-google-places-autocomplete copied to clipboard

Text Clipping

Open hainessss opened this issue 10 years ago • 5 comments

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. screen shot 2015-01-28 at 4 01 13 pm screen shot 2015-01-28 at 4 01 26 pm

hainessss avatar Jan 29 '15 00:01 hainessss

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 avatar Feb 05 '15 15:02 YooJaSung

@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.

kuhnza avatar Feb 15 '15 22:02 kuhnza

I addressed this by mapping "viewValue" in the "format" function to modelValue.name instead of modelValue.formatted_address.

ankitg06 avatar Jun 01 '15 16:06 ankitg06

+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?

davecyen avatar Oct 21 '15 00:10 davecyen

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;
                }

ankitg06 avatar Oct 21 '15 01:10 ankitg06