Skip to content

Commit

Permalink
x-select: set value to null, not undefined, for no selection
Browse files Browse the repository at this point in the history
`Ember.computed.alias` treats `undefined` specially, causing some writes
to fail.
  • Loading branch information
James A. Rosen committed Jun 28, 2015
1 parent 539a041 commit 2e4b88d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default Ember.Component.extend({
if (option) {
this.set('value', option.get('value'));
} else {
this.set('value', undefined);
this.set('value', null);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('XSelect: Single Selection Blockless w/ Option Value', function() {
this.$().prop('selectedIndex', 4).trigger('change');
});
it("has no value", function() {
expect(controller.get('tagged')).to.equal(undefined);
expect(controller.get('tagged')).to.equal(null);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-single-blockless-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('XSelect: Single Selection Blockless', function() {
this.$().prop('selectedIndex', 4).trigger('change');
});
it("has no value", function() {
expect(controller.get('tagged')).to.equal(undefined);
expect(controller.get('tagged')).to.equal(null);
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/x-select-single-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('XSelect: Single Selection', function() {
this.$().prop('selectedIndex', 4).trigger('change');
});
it("has no value", function() {
expect(controller.get('tagged')).to.equal(undefined);
expect(controller.get('tagged')).to.equal(null);
});
});

Expand Down

0 comments on commit 2e4b88d

Please sign in to comment.