From 11acabdcc5a43e3430ead28f48a6cc3beae1bb01 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, 1 Jul 2022 10:06:14 +0300 Subject: [PATCH] Refactor #2540 --- src/components/overlaypanel/OverlayPanel.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue index d08839df2..4ce7a41f1 100755 --- a/src/components/overlaypanel/OverlayPanel.vue +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -22,6 +22,7 @@ import Portal from 'primevue/portal'; export default { name: 'OverlayPanel', inheritAttrs: false, + emits: ['show', 'hide'], props: { dismissable: { type: Boolean, @@ -52,18 +53,20 @@ export default { default: null } }, - emits: ['show', 'hide'], data() { return { visible: false } }, watch: { - dismissable(newValue) { - if (newValue) { - this.bindOutsideClickListener(); - } else { - this.unbindOutsideClickListener(); + dismissable: { + immediate: true, + handler(newValue) { + if (newValue) { + this.bindOutsideClickListener(); + } else { + this.unbindOutsideClickListener(); + } } } },