Always set Component#value at the end of all other values.

Closes #365.
This commit is contained in:
Jürg Lehni 2014-09-29 17:15:33 +02:00
parent 24a80dca27
commit c7970e367d
2 changed files with 6 additions and 3 deletions

View file

@ -24,7 +24,7 @@
"test"
],
"devDependencies": {
"straps": "~1.5.2",
"straps": "~1.6.0",
"acorn": "git://github.com/paperjs/acorn#0.3.2",
"stats.js": "r11"
},

View file

@ -122,8 +122,11 @@ var Component = Base.extend(Callback, /** @lends Component# */{
// NOTE: This triggers setters, which is why we set _dontFire = true,
// and why we can only call this after everything else is set up (e.g.
// setLabel() requires this._labelCell).
Base.set(this, obj);
this._defaultValue = this._value; // after Base.set, through #setValue()
// Exclude name because it's already set, and value since we want to set
// it after range.
Base.set(this, obj, { name: true, value: true });
this.setValue(obj.value);
this._defaultValue = this._value;
// Start firing change events after we have initialized.
this._dontFire = false;
},