diff --git a/dist/base.js b/dist/base.js index c776c02c8..6ae1edc70 100644 --- a/dist/base.js +++ b/dist/base.js @@ -9765,6 +9765,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -9786,20 +9787,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -10043,7 +10048,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 7a36b9b77..d4e8d3e7d 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -44659,6 +44659,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -44680,20 +44681,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -44937,7 +44942,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/dist/bundle.js b/dist/bundle.js index 66da0c91f..e28669de6 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -45198,6 +45198,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -45219,20 +45220,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -45476,7 +45481,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 97e2d3e75..86b238ec3 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -44901,6 +44901,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -44922,20 +44923,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -45179,7 +45184,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/dist/fineui.js b/dist/fineui.js index fa4a8c881..9a1162334 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -45440,6 +45440,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -45461,20 +45462,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -45718,7 +45723,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 4d5290fce..cfdd7fa43 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -32491,6 +32491,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -32512,20 +32513,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -32769,7 +32774,8 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input);/** +BI.shortcut("bi.input", BI.Input); +/** * guy * @extends BI.Single * @type {*|void|Object} diff --git a/src/base/single/input/input.js b/src/base/single/input/input.js index 6a15ab788..f75d6a38c 100644 --- a/src/base/single/input/input.js +++ b/src/base/single/input/input.js @@ -20,6 +20,7 @@ BI.Input = BI.inherit(BI.Single, { BI.Input.superclass._init.apply(this, arguments); var self = this; var ctrlKey = false; + var keyCode = null; var inputEventValid = false; var _keydown = BI.debounce(function (keyCode) { self.onKeyDown(keyCode, ctrlKey); @@ -41,20 +42,24 @@ BI.Input = BI.inherit(BI.Single, { .keydown(function (e) { inputEventValid = false; ctrlKey = e.ctrlKey; + keyCode = e.keyCode; self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments); }) .keyup(function (e) { + keyCode = null; if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) { self._keydown_ = true; _keydown(e.keyCode); } }) .on("input propertychange", function (e) { + // 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了 // 这个事件在input的属性发生改变的时候就会触发(class的变化也算) - if (BI.isNotNull(e.keyCode)) { + if (BI.isNotNull(keyCode)) { + keyCode = null; inputEventValid = true; self._keydown_ = true; - _keydown(e.keyCode); + _keydown(keyCode); } }) .click(function (e) { @@ -298,4 +303,4 @@ BI.Input.EVENT_VALID = "EVENT_VALID"; BI.Input.EVENT_ERROR = "EVENT_ERROR"; BI.Input.EVENT_ENTER = "EVENT_ENTER"; BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.shortcut("bi.input", BI.Input); \ No newline at end of file +BI.shortcut("bi.input", BI.Input);