Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MaTiAtSIE opened this issue Jun 12, 2024 · 3 comments
Open

Comments

@MaTiAtSIE
Copy link

MaTiAtSIE commented Jun 12, 2024

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

  • Operating System: Windows 10
  • Theia Version: 1.45.0
@msujew
Copy link
Member

msujew commented Jun 12, 2024

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
Copy link
Author

MaTiAtSIE commented Jun 12, 2024

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

@msujew
Copy link
Member

msujew commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants