You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application I use cropperjs inside modal. When modal pop up I initialize cropper instance with:
cropper=newCropper(image)
then If user close modal, I will destroy it with:
cropper.destroy()
So if user open modal again it will initialize cropper instance again except sometime cropper instance has created twice.
Minimal reproduction of the problem with instructions
I create jsfiddle, click toggle (or re-run) over and over you will see two cropper instances.
Browser:
Chrome (desktop) version 64
My debugging
After debugging I found start method had called twice which I think one come from normal behavior and another one come from load listener which (If I understand your code correctly) it should destroy in start method here.
In pervious version(v1.2.2) everything works fine, this behavior just appear in new version (v1.3.0). So I look into files changed between 2 versions and found this.
In my opinion I think set onload to null cannot remove listener from addEventListener.
I hope this information will help you.
Thank you.
The text was updated successfully, but these errors were encountered:
Current behavior
In my application I use cropperjs inside modal. When modal pop up I initialize cropper instance with:
then If user close modal, I will destroy it with:
So if user open modal again it will initialize cropper instance again except sometime cropper instance has created twice.
Minimal reproduction of the problem with instructions
I create jsfiddle, click toggle (or re-run) over and over you will see two cropper instances.
Browser:
My debugging
After debugging I found
start
method had called twice which I think one come from normal behavior and another one come fromload
listener which (If I understand your code correctly) it should destroy instart
method here.In pervious version(v1.2.2) everything works fine, this behavior just appear in new version (v1.3.0). So I look into files changed between 2 versions and found this.
In my opinion I think set
onload
tonull
cannot remove listener fromaddEventListener
.I hope this information will help you.
Thank you.
The text was updated successfully, but these errors were encountered: