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

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

Open
2 tasks done
mariseniehaus opened this issue Jan 30, 2025 · 0 comments
Open
2 tasks done

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

mariseniehaus opened this issue Jan 30, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@mariseniehaus
Copy link

mariseniehaus commented Jan 30, 2025

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

@mariseniehaus mariseniehaus added the enhancement New feature or request label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant