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 'tagName' of undefined #58

Open
UrVerySpecial opened this issue Mar 7, 2016 · 1 comment
Open

Cannot read property 'tagName' of undefined #58

UrVerySpecial opened this issue Mar 7, 2016 · 1 comment

Comments

@UrVerySpecial
Copy link

Hi,
first of all, I really appreciate for this module.

I found bug(maybe..).

  1. insert image
  2. click image
  3. then, resizer is displayed
  4. remove image by 'back space'
  5. the resizer still remains
  6. then 'TypeError: Cannot read property 'tagName' of undefined' error occurred

I founding solution, but if you already have, fix it please.

regards,
kang

@UrVerySpecial
Copy link
Author

ngpImageResizer.js

    function removeResizer(event) {
        if (!resizerContainer.parentNode) {
            return;
        }
        if (event && event.target && event.target.tagName === 'IMG') {
            return;
        }
        resizerContainer.style.display = 'none';
        lastVerticalCursorPosition = null;
    }

this code

if (event && event.target.tagName === 'IMG') 
{
    return;
}

to

if (event && event.target && event.target.tagName === 'IMG') {
    return;
}

will be fix, but it's not perfect solution. I think resizer have to hide when image is deleted.

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