Skip to content

Instantly share code, notes, and snippets.

@MiguelMadero
Last active May 19, 2016 20:08
Show Gist options
  • Save MiguelMadero/51ad66ea7f122f0ee12d2e2916ddea92 to your computer and use it in GitHub Desktop.
Save MiguelMadero/51ad66ea7f122f0ee12d2e2916ddea92 to your computer and use it in GitHub Desktop.
Ember 1.13 selection bug
import Ember from 'ember';
Ember.Select.reopen({
didRender() {
this.notifyPropertyChange('selection');
}
});
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
allEmployees: [{id: 1, fullName: 'Miguel'}, {id: 2, fullName: 'Ahmed'}],
// In 1.13 if this isn't initialized it won't be updated, in prior
// versions it just worked.
//selectedEmployees: Ember.computed(function () {
// return [];
//})
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{view Ember.Select content=allEmployees
optionValuePath="content.id"
optionLabelPath="content.fullName"
selection=selectedEmployees
multiple=true}}
{{#each selectedEmployees as |e|}}
{{e.fullName}}
{{/each}}
<br>
<br>
{
"version": "0.8.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "1.13.13",
"ember-data": "1.13.15",
"ember-template-compiler": "1.13.13"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment