Skip to content

[Select/ComboBox] Support for descriptions in options #615

@infernova

Description

@infernova

Prerequisites

Proposal

Implementation suggestion

Add an additional <slot name="description">.
So something along the lines of:-

<sgds-select>
   <sgds-select-option value="1">
      Option 1
      <span slot="description">The description for option 1 goes here.</span>
   </sgds-select-option>
   <sgds-select-option value="2">
      Option 2
      <span slot="description">The description for option 2 goes here. The description for option 2 goes here.</span>
    </sgds-select-option>
</sgds-select>

can be rendered as:-
Image

Implementation considerations

  • Description should not affect input value when option is selected
Image

 

  • Would users be allowed to add descriptions to just selected options or should it mandated that Select options must adhere to a binary standard of all having descriptions or none have descriptions?
  • Should description support for menuList be included even though it has been deprecated?
  • Implementation done for Select should be replicated for ComboBox as well
  • For ComboBox, should descriptions be indexed by user keyboard search?

Motivation and context

Product Portal requires additional descriptions in our Select component to provide users additional information for what each options means. Currently these descriptions are housed on a separate page on the site but it would be beneficial if the information could be immediately available where it is relevant

A rough design mockup as seen below:-
Image

(Ignore the additional Product status: prefix text in the input)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions