Skip to content

Commit

Permalink
fix select for virtual property setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Feb 24, 2012
1 parent 862fe70 commit 1a59c97
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/ui/Select.js
Expand Up @@ -12,12 +12,16 @@ enyo.kind({
this.inherited(arguments);
this.selectedChanged();
},
getSelected: function() {
return Number(this.getNodeProperty("selectedIndex", this.selected));
},
setSelected: function(inIndex) {
// default property mechanism can't track changed correctly for virtual properties
this.setPropertyValue("selected", Number(inIndex), "selectedChanged");
},
selectedChanged: function() {
this.setNodeProperty("selectedIndex", this.selected);
},
getSelected: function() {
return this.getNodeProperty("selectedIndex", this.selected);
},
change: function() {
this.selected = this.getSelected();
},
Expand Down

0 comments on commit 1a59c97

Please sign in to comment.