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

$scope.apply error when backspacing chosen place

Open ghoward500 opened this issue 9 years ago • 3 comments

After I choose a prediction from the list, if I go to the end of the text in the input and hold down backspace to erase the text in the input field there is an error thrown for $scope.apply as it is removing text: Error: [$rootScope:inprog] $apply already in progress http://errors.angularjs.org/1.3.5/$rootScope/inprog?p0=%24apply at REGEX_STRING_REGEXP (.../js/angular.js:63:12) at beginPhase (.../js/angular.js:14644:15) at Scope.$get.Scope.$apply (.../js/angular.js:14388:11) at .../js/autocomplete.js:190:36 at C8 (eval at (eval at (eval at (eval at (https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:60:931)))), :17:495) at B8.(anonymous function).getPlacePredictions (eval at (eval at (eval at (eval at (https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:60:931)))), :18:45) at Ll.eval (eval at (https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:60:931), :1:388) at https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:15:265 at ag (https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:27:432) at Ll.(anonymous function).getPlacePredictions (eval at (https://maps.gstatic.com/maps-api-v3/api/js/20/6/main.js:60:931), :1:345)

It happens every time I test it and does not seem random.

Let me know if you need additional information. Thanks for the module, it has been working great other than this slight issue!

ghoward500 avatar Apr 04 '15 17:04 ghoward500

following #47 I fixed this by modifying in line 192 "$scope.$apply(..." with $timeout. This worked for me..

evba1 avatar Dec 08 '15 14:12 evba1

Turned it into a pull request: https://github.com/kuhnza/angular-google-places-autocomplete/pull/75

cmkramer avatar Jan 18 '16 15:01 cmkramer

I got the same problem........replace $apply with $timeout also works for me

ericklombardo avatar Feb 25 '17 16:02 ericklombardo