Closed alex-oleksenko closed 6 years ago
It seems the new feature auto-sizing
has caused a lot of problems : ((((( #83 also.
I will look into it and do the fix asap, probably in two days though, because I'm a little busy at my job lately. If it's urgent I suggest you can handle the dynamic resizing in the old way, which is to dynamically change the value for :width
and :height
prop.
And thanks for your suggestion, mate.
This issue should be fixed in the newly released version v1.3.1. Please confirm.
No, looks like nothing was changed and it still doesn't work as expected.
This is what changed: https://github.com/zhanziyang/vue-croppa/blob/29ad64a3ed82e91e52bf6a3533d49789147a559a/src/cropper.vue#L502-L512
This method is called in mounted
https://github.com/zhanziyang/vue-croppa/blob/29ad64a3ed82e91e52bf6a3533d49789147a559a/src/cropper.vue#L193
I can't reproduce the error. It would be great if you have time to fix it and submit a pull request.
Would you give v1.3.3 a try?
@zhanziyang yes, it was fixed in version 1.3.3
But any way I would suggest to improve you code a little bit more. You have to call removeEventListener
method for resize
event in beforeDestroy
vuejs hook method, it allows you to avoid calling setContainerSize
method for already destroyed instances.
I have created appropriate pull request.
@alex-oleksenko You are right. I forgot about that one. Thanks for the PR.
I am using
vue-croppa
component in modal dialog and experience this issue after closing my dialog during window resize.I have investigated the issue and figured out that
auto-sizing = true
is the property what affects on that. The problem is withresize
event listener in_setSize
function.I would suggest to use
mounted
method to add event listener andbeforeDestroy
method to remove event listener as well.