zoom-image
zoom-image copied to clipboard
Cannot read property 'setAttribute' of null
Hello. I got that error when I try to destroy
beforeDestroy () {
const destroyZoom = zoom(document.querySelector('img'))
destroyZoom()
console.log('destroyed')
}
why would you call zoom in beforeDestroy hook?
@egoist I was hoping that destroing will help me with the issue with this library, that if you "forget" to close overlay and click Back button, overlay class stays on body.
Here to replicate:
- Go to http://endurable-thunder.surge.sh/#/ then go to Zoom Image page
- Open image by clicking on it.
- Then do nothing, just hit Back button. Voila - overlay doesn't destroys.
Any ideas how to fix it? Because this doesn't help either:
mounted() {
this.destroyZoom = zoom(this.$refs.img)
},
beforeDestroy () {
this.destroyZoom()
}
Any chance it can be fixed? Great plugin, but this issue holding me.