From f9b19d9aa1c1ce7973e59d64cd95d9baffb9c7ca Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Wed, 7 Jun 2017 11:15:25 +0800 Subject: [PATCH] Dialog: fix incorrect updatePopper calls --- packages/dropdown/src/dropdown-menu.vue | 4 +++- packages/select/src/select-dropdown.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/dropdown/src/dropdown-menu.vue b/packages/dropdown/src/dropdown-menu.vue index 364f2af6..32778389 100644 --- a/packages/dropdown/src/dropdown-menu.vue +++ b/packages/dropdown/src/dropdown-menu.vue @@ -16,7 +16,9 @@ mixins: [Popper], created() { - this.$on('updatePopper', this.updatePopper); + this.$on('updatePopper', () => { + if (this.showPopper) this.updatePopper(); + }); this.$on('visible', val => { this.showPopper = val; }); diff --git a/packages/select/src/select-dropdown.vue b/packages/select/src/select-dropdown.vue index be8c77b1..85431213 100644 --- a/packages/select/src/select-dropdown.vue +++ b/packages/select/src/select-dropdown.vue @@ -57,7 +57,9 @@ mounted() { this.referenceElm = this.$parent.$refs.reference.$el; this.$parent.popperElm = this.popperElm = this.$el; - this.$on('updatePopper', this.updatePopper); + this.$on('updatePopper', () => { + if (this.$parent.visible) this.updatePopper(); + }); this.$on('destroyPopper', this.destroyPopper); } };