ember-power-select icon indicating copy to clipboard operation
ember-power-select copied to clipboard

Opt out of default `disabled` options behaviour

Open chaimann opened this issue 5 years ago • 0 comments

Hi! I've got a case where my options collection consists of objects that have disabled property but I don't want power-select to render them as disabled. I have tried to extend options component, copied template and just remove the line with aria-disabled={{ember-power-select-true-string-if-present opt.disabled)}} to not even render aria-disabled flag. I can select option now, but it's not highlightable, i.e. when i move mouse over it will not get a blue background, keyboard also ignores it. Traced it down to the highlight action in power-select.js, where it will ignore highlighting due to

if (option && get(option, 'disabled')) {
        return;
}

Is there anything I can do in order to make power select ignore disabled property? If not do you think it's valid idea to allow this in future versions of power select? I can make a PR for this. Thanks!

chaimann avatar Mar 29 '19 14:03 chaimann