From 82a8f205896b6614760b08c5cc3a0533c10b1036 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 1 Jun 2021 17:28:33 +0800 Subject: [PATCH] =?UTF-8?q?BI-87945:=20=E6=96=B0=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=EF=BC=9A=E8=BE=93=E5=85=A5=E5=9B=9E=E8=BD=A6=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=90=9C=E7=B4=A2=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/editor/editor.textarea.js | 4 ++++ .../multiselect/trigger/editor/editor.patch.js | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index b665939ce..8f4dea97d 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/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); diff --git a/src/widget/multiselect/trigger/editor/editor.patch.js b/src/widget/multiselect/trigger/editor/editor.patch.js index dff1fe7b1..baf630dc2 100644 --- a/src/widget/multiselect/trigger/editor/editor.patch.js +++ b/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 () { @@ -65,7 +72,13 @@ BI.SelectPatchEditor = BI.inherit(BI.Widget, { }, o.el); }, + _clearSplitValue: function () { + console.log(6); + this.editor.setValue(""); + }, + _dealChange: function (type, v) { + console.log(5); var value = ""; if (v !== this.editor.getValue()) { return;