From 44a29f57a03c33ac7a874be224fee7087b1fd901 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Thu, 30 Jan 2020 11:03:03 +0300 Subject: [PATCH] Fixed #167 - Dialog visuals broken when initially displayed --- src/components/dialog/Dialog.vue | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/dialog/Dialog.vue b/src/components/dialog/Dialog.vue index ac7c141f9..1b9dec8e7 100644 --- a/src/components/dialog/Dialog.vue +++ b/src/components/dialog/Dialog.vue @@ -64,21 +64,15 @@ export default { }, documentKeydownListener: null, updated() { - if (this.$refs.mask) { - this.dialogClasses = this.$vnode.data.class; - this.dialogStyles = this.$vnode.data.style; - DomHandler.removeClass(this.$refs.mask, this.$vnode.data.class); - if (this.$vnode.data.style) { - Object.keys(this.$vnode.data.style).forEach((key) => { - this.$refs.mask.style[key] = ''; - }); - } - } + this.removeStylesFromMask(); if (this.visible && !this.maskVisible) { this.maskVisible = true; } }, + mounted() { + this.removeStylesFromMask(); + }, beforeDestroy() { this.disableModality(); }, @@ -165,6 +159,18 @@ export default { window.document.removeEventListener('keydown', this.documentKeydownListener); this.documentKeydownListener = null; } + }, + removeStylesFromMask() { + if (this.$refs.mask) { + this.dialogClasses = this.$vnode.data.class; + this.dialogStyles = this.$vnode.data.style; + DomHandler.removeClass(this.$refs.mask, this.$vnode.data.class); + if (this.$vnode.data.style) { + Object.keys(this.$vnode.data.style).forEach((key) => { + this.$refs.mask.style[key] = ''; + }); + } + } } }, computed: {