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

Add disabled property to dropdown-select-item #2114

Closed
marcuskrahl opened this issue Sep 5, 2023 · 3 comments · Fixed by #2174
Closed

Add disabled property to dropdown-select-item #2114

marcuskrahl opened this issue Sep 5, 2023 · 3 comments · Fixed by #2174
Labels
feature New component features and enhancements

Comments

@marcuskrahl
Copy link
Contributor

Describe the feature request
The Dropdown Select component currently lacks the ability to disable individual Dropdown Select Items.
It is supposed to replace native <select> elements and it is possible for <option> elements inside a <select> or <scale-dropdown> element to be disabled.

Describe the use case
It is sometimes necessary to show options to a user which are currently unavailable, but might be available under different circumstances. When showing these disabled options we can also provide a reason for the user why these options are unavailable.

Describe alternatives you've considered

  • using <scale-dropdown>, but it is deprecated
  • using checkboxes, but sometimes a dropdown is the most appropriate control

Additional context
We might also want to consider other features of native selects, lke <optgroup>, etc.

@marcuskrahl marcuskrahl added the feature New component features and enhancements label Sep 5, 2023
@dadadcko
Copy link
Contributor

dadadcko commented Sep 28, 2023

Hello! I'd like to help. May I take and work on this feature?

Edit: Mention one of code owners to get attention
@felix-ico

@felix-ico
Copy link
Collaborator

Hi @dadadcko, sorry for the delay, I was out of office. Yes of course you may open a PR for this feature request, and let me know if you have any questions!

@dadadcko
Copy link
Contributor

Hey @felix-ico, I have dig through source-code and see that dropdown-select-item only acts as placeholder for data but all styles and logic is actually implemented in dropdown-select.
Regarding the styles, should be disabled implemented the same way? E.g. disabled text color should be set from (by) dropdown-select, or directly in dropdown-select-item ?

The above also makes problem for implementing disabled reason message. Currently, when any option is selected, the whole element is rendered. This makes problem when we only want to display reason message in list-pad box, not when the element is already actually selected. Should displaying the reason message be part of (and responsibility of) parent - dropdown-select ?

I have already experimented with both solutions, but I want to get clarification from you before I commit the final implementation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New component features and enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants