Closed evpozdniakov closed 3 years ago
It works fine for the case like in your example page:
But if the data property is an array of objects like { id, name } then there is no way to disable a particular item.
{ id, name }
Here is an example:
<DropdownList<{ id: string, name: string }> data={[{ id: 'one', name: 'One' }, { id: 'two', name: 'Two' }, { id: 'three', name: 'Three' }]} dataKey="id" disabled={[{ id: 'one', name: 'One' }, { id: 'two', name: 'Two' }]} open textField="name" />
The result:
that is because it does a === comparison of the objects in the array, for performance reasons. You should use the actual instances of your data items
===
@jquense thank you, make sense!
It works fine for the case like in your example page:
But if the data property is an array of objects like
{ id, name }
then there is no way to disable a particular item.Here is an example:
The result: