From f38ed3675fb64bc769fd5f47a9f7d183c3162fae Mon Sep 17 00:00:00 2001 From: Knox Date: Tue, 26 Jun 2018 18:34:20 +0800 Subject: [PATCH 1/2] fixed editorbox stayOnTop exTxt value error (#2905) --- cocos2d/core/editbox/CCSGEditBox.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos2d/core/editbox/CCSGEditBox.js b/cocos2d/core/editbox/CCSGEditBox.js index 221aa07e9a..902eaea376 100644 --- a/cocos2d/core/editbox/CCSGEditBox.js +++ b/cocos2d/core/editbox/CCSGEditBox.js @@ -1049,6 +1049,9 @@ _ccsg.EditBox.KeyboardReturnType = KeyboardReturnType; else if (inputFlag === InputFlag.INITIAL_CAPS_SENTENCE) { this._editBox._text = capitalizeFirstLetter(this._editBox._text); } + if (this._edTxt) { + this._edTxt.value = this._editBox._text; + } }; proto._updateLabelStringStyle = function() { From 93804c9f005b4001183abd68017639fe9d0bace0 Mon Sep 17 00:00:00 2001 From: Knox Date: Thu, 28 Jun 2018 15:58:43 +0800 Subject: [PATCH 2/2] fix _unregisterAccelerometerEvent err (#2918) --- cocos2d/core/platform/CCInputExtension.js | 5 ++++- cocos2d/core/platform/CCInputManager.js | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/platform/CCInputExtension.js b/cocos2d/core/platform/CCInputExtension.js index f9f2590999..49c4994f24 100644 --- a/cocos2d/core/platform/CCInputExtension.js +++ b/cocos2d/core/platform/CCInputExtension.js @@ -32,6 +32,8 @@ var inputManager = require("./CCInputManager"); inputManager.__instanceId = cc.ClassManager.getNewInstanceId(); +var _didAccelerateFun; + /** * whether enable accelerometer event * @method setAccelerometerEnabled @@ -92,7 +94,8 @@ inputManager._registerAccelerometerEvent = function(){ _t._minus = -1; } - w.addEventListener(_deviceEventType, _t.didAccelerate.bind(_t), false); + _didAccelerateFun = _t.didAccelerate.bind(_t); + w.addEventListener(_deviceEventType, _didAccelerateFun, false); }; inputManager._unregisterAccelerometerEvent = function () { diff --git a/cocos2d/core/platform/CCInputManager.js b/cocos2d/core/platform/CCInputManager.js index 63a34acbdc..7cd689928f 100644 --- a/cocos2d/core/platform/CCInputManager.js +++ b/cocos2d/core/platform/CCInputManager.js @@ -610,6 +610,5 @@ js.get(cc, 'inputManager', function () { cc.warnID(1405, 'cc.inputManager', 'cc.systemEvent'); return inputManager; }); -_cc.inputManager = inputManager; -module.exports = inputManager; +module.exports = _cc.inputManager = inputManager;