Browse Source

Merge pull request #1018 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '734a844b7368ef2c2df7a9d4b45a5e5dae4ab4fa':
  BI-48029 fix: STOP事件没有发
master
guy 5 years ago
parent
commit
674d062197
  1. 4
      src/base/single/input/input.js

4
src/base/single/input/input.js

@ -166,6 +166,8 @@ BI.Input = BI.inherit(BI.Single, {
} }
this.fireEvent(BI.Input.EVENT_KEY_DOWN); this.fireEvent(BI.Input.EVENT_KEY_DOWN);
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){ if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange(); this._valueChange();
} }
@ -175,7 +177,7 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_PAUSE); this.fireEvent(BI.Input.EVENT_PAUSE);
this._defaultState(); this._defaultState();
} else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) && } 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.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_STOP); this.fireEvent(BI.Input.EVENT_STOP);
} }

Loading…
Cancel
Save