If I handle the onopen action, and call e.preventDefault, the dropdown still opens.
Example. In my case I want to prevent clicks on the select box from opening the options list.
{{#power-select-multiple
...
options=(readonly items)
opened=false
onopen=(action "opened")
...
as |item|
}}
...
...
opened(select, e) {
if(e.type === 'mousedown') {
e.preventDefault(); // this does not work
select.actions.close(); // this does work
}
},
...
@Ramblurr Yes, I understand that this is confusing, but at the moment onopen is more a hook than an event. It doesn't happen when the component is about to open but when the component has been already opened.
I think that this is probably wrong and I'm going to change it
@Ramblurr Fixed in master.
At the moment there is two ways of preventing the dropdown from opening/close: return false or calling preventDefault on the event. I'm not sure if I'll keep both ways in the future, but if I only keep one it will be return false.
Use that for safety.