From 82e6ddf102673f20aba8d4139f500b12e9b15b7e Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 3 Feb 2020 10:25:08 +0300 Subject: [PATCH] Fixed #182 - Style classes are not rendered correctly on Dialog --- src/components/dialog/Dialog.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/dialog/Dialog.vue b/src/components/dialog/Dialog.vue index 45f11f438..0aa6bf7ad 100644 --- a/src/components/dialog/Dialog.vue +++ b/src/components/dialog/Dialog.vue @@ -162,14 +162,17 @@ export default { }, 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) => { + if (this.dialogStyles) { + Object.keys(this.dialogStyles).forEach((key) => { this.$refs.mask.style[key] = ''; }); } + + this.dialogClasses = this.$vnode.data.class || this.$vnode.data.staticClass; + if (this.dialogClasses) { + this.$refs.mask.classList = 'p-dialog-wrapper' + (this.modal && ' p-component-overlay p-dialog-mask p-fadein'); + } } } },