allenhwkim / angularjs-google-maps

The Simplest AngularJS Google Maps V3 Directive
http://ngmap.github.io
MIT License
1.52k stars 516 forks source link

Console Error: Cannot read property 'parentElement' of null when using maps-lazy-load-params on NgMap page #879

Closed nicholaspretorius closed 5 years ago

nicholaspretorius commented 5 years ago

Good day Allen,

When viewing the NgMap demo page at: https://ngmap.github.io/#/!map-lazy-load-params.html

A console error is displayed when clicking on the map marker to open the info window.

Steps to reproduce - no plunker provided as this exists on the NgMap demo page

Current behavior

Line 114 of info-window.js

var infoWindowContainerEl = infoWindow.content.parentElement.parentElement.parentElement;

image

Expected/desired behavior

Other information

madmarcel commented 5 years ago

I'm seeing the same issue. Working on a fix...

maxdor1 commented 5 years ago

Any update on this? I have the same problem in my project..

Thank you!

allenhwkim commented 5 years ago

I believe this happens because of a racing condition. I think Chrome browser tries perform faster than before. I can wrap like with a if condition

if (infoWindow.content.parentElement) {
  var infoWindowContainerEl = infoWindow.content.parentElement.parentElement.parentElement;
  infoWindowContainerEl.className = "ng-map-info-window";
}
allenhwkim commented 5 years ago

v1.18.5 is released with this fix

nicholaspretorius commented 5 years ago

Thank you!

wholeinsoul commented 5 years ago

v1.18.5 is released with this fix

HI @allenhwkim , when will you release this version v1.18.5 ? Thank you.

EDIT: For future reference: It is released here. //cdn.jsdelivr.net/npm/ngmap@1.18.5/build/scripts/ng-map.min.js"

Rouvo commented 5 years ago

Hi @allenhwkim, I really like your library, but I ran into the same bug.

When are you going to realease the mentioned version with the bug fix?

wholeinsoul commented 5 years ago

For future reference: It is released here. //cdn.jsdelivr.net/npm/ngmap@1.18.5/build/scripts/ng-map.min.js"

Hi @allenhwkim, I really like your library, but I ran into the same bug.

When are you going to realease the mentioned version with the bug fix?

Rouvo commented 5 years ago

Thanks for the quick reply, enjoy the day and thanks for your great work! 👍