fix: fix error element has been destroyed

This commit is contained in:
weishaodaren 2023-08-15 10:27:05 +08:00
parent f4a557955d
commit 88c48e1b7c

View file

@ -381,7 +381,9 @@ export default class VanillaTilt {
if (this.glare) this.glareElement.style.transition = `opacity ${this.settings.speed}ms ${this.settings.easing}`;
this.transitionTimeout = setTimeout(() => {
this.element.style.transition = "";
if (this.element) {
this.element.style.transition = "";
}
if (this.glare) {
this.glareElement.style.transition = "";
}