mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 02:02:41 +08:00
Merge pull request #348 from knoxHuang/master
fix EditorBox string value is not updated bug
This commit is contained in:
@@ -44,14 +44,17 @@ var EditBox = cc.Class({
|
||||
},
|
||||
|
||||
properties: {
|
||||
_string: '',
|
||||
/**
|
||||
* Input string of EditBox.
|
||||
* @property {String} string
|
||||
*/
|
||||
string: {
|
||||
default: '',
|
||||
notify: function() {
|
||||
this._sgNode.string = this.string;
|
||||
get: function () {
|
||||
return this._sgNode.string;
|
||||
},
|
||||
set: function(value) {
|
||||
this._sgNode.string = this._string = value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -226,7 +229,7 @@ var EditBox = cc.Class({
|
||||
sgNode.inputMode = this.inputMode;
|
||||
sgNode.maxLength = this.maxLength;
|
||||
|
||||
sgNode.string = this.string;
|
||||
sgNode.string = this._string;
|
||||
sgNode.fontSize = this.fontSize;
|
||||
sgNode.fontColor = this.fontColor;
|
||||
sgNode.placeHolder = this.placeHolder;
|
||||
|
||||
Reference in New Issue
Block a user