advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

Reset method fire this.$refs.stencil is null #213

Closed ggueyraud closed 1 year ago

ggueyraud commented 1 year ago

Hello I call reset method on a ref of Cropper component and I have this error Uncaught TypeError: this.$refs.stencil is null, if any of you have an idea to solve that. Thanks for your time!

Codebase intentionaly simplified:

<script setup>
// Import here

const my_cropper = ref(null);

function reset() 
  my_cropper.value.reset();
}
</script>

<template>
  <Cropper ref="my_cropper" />

  <button @click="reset()">Reset</button>
</template>
Norserium commented 1 year ago

@rustre-undefined, hello. Could you reproduce this issue on sandbox?

Norserium commented 1 year ago

@rustre-undefined, try to update to 2.8.6. Perhaps, it could help.

ggueyraud commented 1 year ago

Sorry I haven't seen the answer :/ It was a mistake due the async behavior of image loading, everything is okay with the dependency!

Norserium commented 1 year ago

@rustre-undefined, all well that ends well.