From b964efae4e0f1ac5616057566986015b43470c91 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Fri, 2 Feb 2018 07:55:09 +0100 Subject: [PATCH] Emit change on pointer up also --- src/components/slider/slider.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/slider/slider.vue b/src/components/slider/slider.vue index c4140d7..d8e29e4 100644 --- a/src/components/slider/slider.vue +++ b/src/components/slider/slider.vue @@ -240,6 +240,7 @@ if (this.dragging) { this.dragging = false; this.$refs[`${this.pointerDown}Tooltip`].visible = false; + this.emitChange(); } this.pointerDown = ''; @@ -261,14 +262,18 @@ if (!this.dragging) { if (this.currentValue[index] !== this.oldValue[index]) { - const exportValue = this.range ? this.currentValue : this.currentValue[0]; - this.$emit('on-change', exportValue); - this.dispatch('FormItem', 'on-form-change', exportValue); + this.emitChange(); this.oldValue[index] = this.currentValue[index]; } } }, + emitChange(){ + const exportValue = this.range ? this.currentValue : this.currentValue[0]; + this.$emit('on-change', exportValue); + this.dispatch('FormItem', 'on-form-change', exportValue); + }, + sliderClick (event) { if (this.disabled) return; const currentX = this.getPointerX(event); -- libgit2 0.21.4