From e01b7dbf1b20bf22295de70fe3bbaacc1926b834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 6 Aug 2021 11:00:28 +0300 Subject: [PATCH] Fixed #1418 - Toast does not clear hide timeout on beforeDestroy --- 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 281f3acd53..a5c25b38af 100755 --- a/src/components/toast/ToastMessage.vue +++ b/src/components/toast/ToastMessage.vue @@ -28,16 +28,22 @@ export default { }, this.message.life) } }, + beforeDestroy() { + 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: {