Skip to content

[Feature Request]: Empty State in Groups within Selectors #3232

Closed
@mariseniehaus

Description

@mariseniehaus

Description

In Selectors, I use groups to group options in logical ways.
Within a group, I would like there to be an empty state so that if no options exist under that group, a message may be displayed.
Cloudscape supports an empty state if no options exist in the selector, but does not support empty state if no options exist within a group of a selector.

<Select
      selectedOption={selectedOption}
      onChange={({ detail }) =>
        setSelectedOption(detail.selectedOption)
      }
      options={[
        {
          label: "Group 1",
          options: [],
          empty: "There are no options in group 1" // This is what I'm looking for
        },
        {
          label: "Group 2",
          options: [
            { label: "Option 4", value: "4" },
            { label: "Option 5", value: "5" }
          ]
        }
      ]}
      empty="No options exist for this selector" // This is what is already supported
    />

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions