From a3161038d90bfe5d02cebb21b45183c2f22e0cd1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 3 Dec 2021 15:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E5=88=B0=E5=8E=9F=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/input/input.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 44605fc78..837d6d205 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -24,7 +24,7 @@ BI.Input = BI.inherit(BI.Single, { var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); self._keydown_ = false; - }, BI.EVENT_RESPONSE_TIME); + }, 300); var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, { "leading": true, "trailing": false @@ -33,7 +33,10 @@ BI.Input = BI.inherit(BI.Single, { "leading": true, "trailing": false }); - this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME); + this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, { + "leading": true, + "trailing": false + }); this.element .keydown(function (e) { inputEventValid = false; @@ -92,7 +95,11 @@ BI.Input = BI.inherit(BI.Single, { _blur: function () { var self = this; - blur(); + if (self._keydown_ === true) { + BI.delay(blur, 300); + } else { + blur(); + } function blur () { if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {