eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.12k stars 2.5k forks source link

SelectOption disabled is eventually not used or wrongly used from my side. #13804

Open MaTiAtSIE opened 5 months ago

MaTiAtSIE commented 5 months ago

Bug Description:

Steps to Reproduce:

Hey, I use the SelectOption array

const [method, ] = React.useState('xxx');
const methodOptions: SelectOption[] = [
    { value: 'xxx', label: 'xxx', description: 'xxx',  },
    { value: 'yyy', label: 'yyy', description: 'yyy', disabled: true },
];

in a React Component with

<SelectComponent options={methodOptions} defaultValue={method}  onChange={onMethodChanged} />

. However, 'yyy' can still be selected in the UI which is not expected from my side. The questions are:

  1. Is the usage correct?
  2. Do you need more information?
  3. Does the disabled option disable the SelectOption?

Additional Information

msujew commented 5 months ago

I believe I never actually implemented the disabled option behavior - no one has noticed yet. The main reason the property is there at all was to keep compability with the HTML option interface.

MaTiAtSIE commented 5 months ago

Thanks for the reply. Would you recommend to use the disabled option and wait for an update or to implement a workaround?

msujew commented 5 months ago

I'm not entirely sure I'll have time to get to this soon. I'd be happy to review in case you care to contribute the feature though. Not a big fan of workarounds, given that the component is pretty closed off.