From 734a844b7368ef2c2df7a9d4b45a5e5dae4ab4fa Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 16 Jul 2019 14:14:55 +0800 Subject: [PATCH] =?UTF-8?q?BI-48029=20fix:=20STOP=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/input/input.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 68e975326..1d8372dcb 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -166,6 +166,8 @@ BI.Input = BI.inherit(BI.Single, { } this.fireEvent(BI.Input.EVENT_KEY_DOWN); + // _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务 + var lastValue = this._lastValue; if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){ this._valueChange(); } @@ -175,7 +177,7 @@ BI.Input = BI.inherit(BI.Single, { this.fireEvent(BI.Input.EVENT_PAUSE); this._defaultState(); } else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) && - BI.trim(this.getValue()) === "" && (this._lastValue !== null && BI.trim(this._lastValue) !== "")) { + BI.trim(this.getValue()) === "" && (lastValue !== null && BI.trim(lastValue) !== "")) { this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this); this.fireEvent(BI.Input.EVENT_STOP); }