Skip to content

Instantly share code, notes, and snippets.

@sukima
Last active April 29, 2020 14:24
Show Gist options
  • Save sukima/d1e8180ec09a0835e5618f613ac4e632 to your computer and use it in GitHub Desktop.
Save sukima/d1e8180ec09a0835e5618f613ac4e632 to your computer and use it in GitHub Desktop.
power-select mouse bug
import Ember from 'ember';
export default Ember.Controller.extend({
catalog: [
'Reese\'s pieces',
'Blow Pops',
'Almond Joy',
'M&Ms',
'Snickers',
'Mr. Goodbar'
],
selected: [
'Reese\'s pieces',
'Blow Pops'
],
events: [],
actions: {
registerChange(values = []) {
this.get('events').pushObject(`Power Select changed [${values.join()}]`);
this.set('selected', values);
}
}
});
<div id="container">
<ul style="float: right;">
{{#each events as |event|}}
<li>{{event}}</li>
{{/each}}
</ul>
<div style="width: 200px;">
{{#power-select-multiple
closeOnSelect=false
options=catalog
selected=selected
onchange=(action "registerChange")
as |option|}}
{{option}}
{{/power-select-multiple}}
</div>
<ul>
{{#each selected as |candy|}}
<li>{{candy}}</li>
{{else}}
<li>No candy selected</li>
{{/each}}
</ul>
</div>
{
"version": "0.12.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": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-power-select": "1.8.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment