React-select: [2.0] Disabling options doesn't work anymore

Created on 14 Jun 2018  路  5Comments  路  Source: JedWatson/react-select

Hello,

Disabling an option doesn't work anymore.

The documentation says we should just add a disabled: true to the options to make it grayed but now it's not working, even by setting isOptionDisabled={() => false}.

Any ideas?

Most helpful comment

@gwyneplaine, but the document says:
You can use a disabled property to indicate whether the option is disabled or not.
This might misleading other peoples, thx!!!

All 5 comments

Hi,

Can you point the link to the documentation where it states that passing disabled property to the options marks it as disabled?I can not find it.

Anyway, isOptionDisabled works, here is working example.

Your function return false so the option is not disabled.

Cheers!

@TheSuperFly, as specified by @smoleniuch above, we expose an isOpbionDisabled prop of the following shape (option) => !!option.isDisabled, which defaults to checking for a 'isDisabled' property on your option.

@gwyneplaine, but the document says:
You can use a disabled property to indicate whether the option is disabled or not.
This might misleading other peoples, thx!!!

The examples use a 'disabled' property which was misleading.

@dlikhten Absolutely!!! I was stuck there because of the example!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

geraldfullam picture geraldfullam  路  3Comments

yrabinov picture yrabinov  路  3Comments

AchinthaReemal picture AchinthaReemal  路  3Comments

batusai513 picture batusai513  路  3Comments

pgoldweic picture pgoldweic  路  3Comments