Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix beta build #142

Merged
merged 2 commits into from
Sep 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ env:
- EMBER_TRY_SCENARIO=default
- EMBER_TRY_SCENARIO=ember-1.13
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary

matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
Expand Down
12 changes: 11 additions & 1 deletion addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ export default Ember.Component.extend({
*/
'oneWay': Ember.computed.alias('one-way'),

/**
* Set to true when `willDestroyElement` is called.
*
* @private
* @property isXSelectDestroying
*/
isXSelectDestroying: false,

/**
* The collection of options for this select box. When options are
* inserted into the dom, they will register themselves with their
Expand Down Expand Up @@ -194,6 +202,8 @@ export default Ember.Component.extend({
willDestroyElement: function() {
this._super.apply(this, arguments);

this.set('isXSelectDestroying', true);

// might be overkill, but make sure options can get gc'd
this.get('options').clear();
this.$().off('blur');
Expand Down Expand Up @@ -228,7 +238,7 @@ export default Ember.Component.extend({
this.get('options').removeObject(option);

// We don't want to update the value if we're tearing the component down.
if (!this.get('isDestroying')) {
if (!this.get('isXSelectDestroying')) {
this._updateValue();
}
}
Expand Down