ember-multiselect-checkboxes
ember-multiselect-checkboxes copied to clipboard
Disable individual checkboxes
Consider allowing for disabling individual checkboxes.
That sounds like something for which perhaps a custom template is better suited:
{{#multiselect-checkboxes options=options selection=selectedOptions as |option isSelected|}}
<li>
<label>
{{input type="checkbox" checked=isSelected disabled=option.isDisabled}}
{{option.label}}
</label>
</li>
{{/multiselect-checkboxes}}
Would that work for you?
Thank you for the suggestion, but I think the suitability depends on how you interpret the objective of the addon. It'd be nice to use the addon as a way to manage an array of checkboxes, but I understand if your intention is to treat the addon as a new type of input control that happens to render itself as a bunch of checkboxes.
I don't think those goals are necessarily mutually exclusive, it's just that I've become somewhat apprehensive about making this addon more complex than it already is. Upon reflection though, perhaps this could be implemented by adding a disabledProperty
attribute to the component, which might indeed be a worthwhile addition.
Thanks for the consideration. I was also thinking you could pass in an array of disabled options (similar to how the selection
attribute passes in an array of selection options) -- but I'm guessing that approach might not scale as well?