{"action":"opened","issue":{"url":"https://api.github.com/repos/cibernox/ember-power-select/issues/706","repository_url":"https://api.github.com/repos/cibernox/ember-power-select","labels_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/706/labels{/name}","comments_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/706/comments","events_url":"https://api.github.com/repos/cibernox/ember-power-select/issues/706/events","html_url":"https://github.com/cibernox/ember-power-select/issues/706","id":181170497,"number":706,"title":"Removing power-select as result of selection causes error","user":{"login":"rlivsey","id":3740,"avatar_url":"https://avatars.githubusercontent.com/u/3740?v=3","gravatar_id":"","url":"https://api.github.com/users/rlivsey","html_url":"https://github.com/rlivsey","followers_url":"https://api.github.com/users/rlivsey/followers","following_url":"https://api.github.com/users/rlivsey/following{/other_user}","gists_url":"https://api.github.com/users/rlivsey/gists{/gist_id}","starred_url":"https://api.github.com/users/rlivsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlivsey/subscriptions","organizations_url":"https://api.github.com/users/rlivsey/orgs","repos_url":"https://api.github.com/users/rlivsey/repos","events_url":"https://api.github.com/users/rlivsey/events{/privacy}","received_events_url":"https://api.github.com/users/rlivsey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-05T14:26:36Z","updated_at":"2016-10-05T14:26:36Z","closed_at":null,"body":"If you have a select which is removed from the template as a result of making a selection:\r\n\r\n```handlebars\r\n{{#unless something}}\r\n  {{power-select onchange=(action (mut something)) options=foo}}\r\n{{/unless}}\r\n```\r\n\r\nWhen a selection is made, it then calls `updateState` in the next run-loop, by which point the select is being destroyed, causing an error:\r\n\r\n![screen shot 2016-10-05 at 15 22 59](https://cloud.githubusercontent.com/assets/3740/19117062/a0d6b3d4-8b0f-11e6-86df-5ae8fbbe4643.png)\r\n\r\nWe should probably check for `this.isDestroying` somewhere, either in `onClose` or in `updateState` itself?\r\n"}}
{"actor":{"display_login":"rlivsey"}}