From 0333cf1fce8a20246397913f66cc6d8036c6d234 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Fri, 6 Aug 2021 10:29:07 +0300 Subject: [PATCH] Fixed #1415 - Toast does not clear hide timeout on unmount --- src/components/toast/ToastMessage.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/toast/ToastMessage.vue b/src/components/toast/ToastMessage.vue index 568986263..15f8acafb 100755 --- a/src/components/toast/ToastMessage.vue +++ b/src/components/toast/ToastMessage.vue @@ -34,16 +34,22 @@ export default { }, this.message.life) } }, + beforeUnmount() { + this.clearCloseTimeout(); + }, methods: { close() { this.$emit('close', this.message); }, onCloseClick() { + this.clearCloseTimeout(); + this.close(); + }, + clearCloseTimeout() { if (this.closeTimeout) { clearTimeout(this.closeTimeout); + this.closeTimeout = null; } - - this.close(); } }, computed: {