Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'innerText' of undefined at updatePopup #1179

Open
szmalec opened this issue Dec 12, 2017 · 0 comments
Open

Cannot read property 'innerText' of undefined at updatePopup #1179

szmalec opened this issue Dec 12, 2017 · 0 comments

Comments

@szmalec
Copy link

szmalec commented Dec 12, 2017

Hello.

I would like to report problem which occurs in specific scenario. I have prepared plunker which shows where problem is (in plunker click button "Test #2 (ERROR)" and then click red marker)... As stated in this issue title "Cannot read property 'innerText' of undefined at updatePopup" error occurs. It occurs only if marker message is div with ng-include directive AND marker focus property is false AND when we change marker icon in marker click handler. There is no problem if focus property has true value... There is also no problem when message does not contain ng-include directive but is normal text...

Problem is in the same line as in #841. Fast fix for problem reported here is one line of code:

      if (marker._popup._contentNode === undefined)
          return;

but I don't know if it is good solution... Maybe root cause is somewhere in code which leads to state when marker._popup._contentNode === undefined

    // Update the icon property
    if (!isObject(markerData.icon)) {
      // If there is no icon property or it's not an object
      if (isObject(oldMarkerData.icon)) {
        // If there was an icon before restore to the default
        marker.setIcon(createLeafletIcon());
        marker.closePopup();
        marker.unbindPopup();
        if (isString(markerData.message)) {
          marker.bindPopup(markerData.message, markerData.popupOptions);
        }
      }
    }

Can you apply fix for described scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant