From 38820373bc94d72fe24bf1af316d6276609bbad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=95=8F?= Date: Wed, 24 Apr 2019 14:05:02 +0800 Subject: [PATCH] [bugfix] Slider: fix slider drag and `value` props change at the same time can not drag success (#3206) --- packages/slider/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/slider/index.js b/packages/slider/index.js index b2e83ecf3..f307e1505 100644 --- a/packages/slider/index.js +++ b/packages/slider/index.js @@ -48,12 +48,13 @@ export default sfc({ const total = this.vertical ? rect.height : rect.width; const diff = (delta / total) * 100; - this.updateValue(this.startValue + diff); + this.newValue = this.startValue + diff; + this.updateValue(this.newValue); }, onTouchEnd() { if (this.disabled) return; - this.updateValue(this.value, true); + this.updateValue(this.newValue, true); }, onClick(event) {