diff --git a/packages/phy-scroll/index.js b/packages/phy-scroll/index.js index c0555cfd0..1a3ff2f1c 100644 --- a/packages/phy-scroll/index.js +++ b/packages/phy-scroll/index.js @@ -1,4 +1,4 @@ -/* phy-scroll v1.0.2 +/* phy-scroll v1.0.3 * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi/tree/master/packages/phy-scroll * MIT Licensed. @@ -402,13 +402,13 @@ if (result > this.max) result = this.max; if (result < this.min) result = this.min; this.to(result, time, ease); - this.index = rpt + 1 + this.index = (value < 0 ? -1 : 1) * (rpt + 1) } else { result = (value < 0 ? -1 : 1) * rpt * this.step; if (result > this.max) result = this.max; if (result < this.min) result = this.min; this.to(result, time, ease); - this.index = rpt + this.index = (value < 0 ? -1 : 1) * rpt } }, destroy: function () { diff --git a/packages/phy-scroll/package.json b/packages/phy-scroll/package.json index 223380521..eb47b917b 100644 --- a/packages/phy-scroll/package.json +++ b/packages/phy-scroll/package.json @@ -1,6 +1,6 @@ { "name": "phy-scroll", - "version": "1.0.2", + "version": "1.0.3", "description": "Physical scroll.", "main": "index.js", "scripts": {