jakezatecky/react-dual-listbox

Ability to add disabled attribute to specific options

Closed this issue · 2 comments

bodn commented

I have the use case where some options need to be disabled based on a flag in our data. To display to the user that the option is there but cannot be selected based on some condition.

Since react-dual-listbox leverages HTML option tag, is there capacity to add a optional boolean flag to our options data, to set specific options as disabled?

const options = [
 { value: 'one', label: 'Option One' },
 { value: 'two', label: 'Option Two' },
 { value: 'three', label: 'Option Three', disabled: true }
]

This is supported in the v2.1 branch but needs to be released. I'll keep this issue open until then.

Covered in #80.