Browse Source

Pull request #1944: BI-87945: 新交互:但复选下拉输入回车清空当前搜索框

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'fe770db8a17d94547af6d6ebc58a93b2cd621459':
  BI-87949 fix: 重置start状态
  revert log
  BI-87945: 新交互:输入回车清空当前搜索框
es6
windy 3 years ago
parent
commit
ca28e2f6f2
  1. 4
      src/base/single/editor/editor.textarea.js
  2. 12
      src/widget/multiselect/trigger/editor/editor.patch.js

4
src/base/single/editor/editor.textarea.js

@ -82,6 +82,9 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
// 水印快速消失
self.watermark && self.watermark.setVisible(false);
});
this.content.element.keyup(function (e) {
self.fireEvent(BI.TextAreaEditor.EVENT_KEY_DOWN, e.keyCode);
});
this.content.element.click(function (e) {
e.stopPropagation();
});
@ -246,4 +249,5 @@ BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR";
BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.TextAreaEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TextAreaEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.TextAreaEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);

12
src/widget/multiselect/trigger/editor/editor.patch.js

@ -51,6 +51,13 @@ BI.SelectPatchEditor = BI.inherit(BI.Widget, {
debounceInputChange(type, v);
}
},
}, {
eventName: BI.Editor.EVENT_KEY_DOWN,
action: function (keyCode) {
if (keyCode === BI.KeyCode.ENTER) {
self._clearSplitValue();
}
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action: function () {
@ -59,12 +66,17 @@ BI.SelectPatchEditor = BI.inherit(BI.Widget, {
}, {
eventName: BI.Editor.EVENT_BLUR,
action: function () {
self._start = false;
self.fireEvent(BI.SelectPatchEditor.EVENT_BLUR, arguments);
},
}],
}, o.el);
},
_clearSplitValue: function () {
this.editor.setValue("");
},
_dealChange: function (type, v) {
var value = "";
if (v !== this.editor.getValue()) {

Loading…
Cancel
Save