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

[BUG] OuiSplitButton still displays dropdown when no options available #1208

Closed
pjfitzgibbons opened this issue Jan 12, 2024 · 3 comments · Fixed by #1209
Closed

[BUG] OuiSplitButton still displays dropdown when no options available #1208

pjfitzgibbons opened this issue Jan 12, 2024 · 3 comments · Fixed by #1209
Labels
bug Something isn't working

Comments

@pjfitzgibbons
Copy link
Contributor

Describe the bug

When options is blank-array, or options is not present at all, the "dropdown" side of SplitButton is still displayed, and when clicked an empty Popover is rendered.

To Reproduce
Steps to reproduce the behavior:

  1. Use this TSX :
<OuiSplitButton >Test</OuiSplitButton>
  1. See dropdown button
  2. Click dropdown button
  3. See empty Popver (2-pixel line under dropdown)

Expected behavior
No dropdown button, no popover

@pjfitzgibbons pjfitzgibbons added bug Something isn't working untriaged labels Jan 12, 2024
@BSFishy BSFishy removed the untriaged label Jan 25, 2024
@AMoo-Miki
Copy link
Collaborator

AMoo-Miki commented Jul 12, 2024

While I see where you are coming from, I wouldn't categorize this as a bug because this is how an empty native <select /> elements works too: it shows a minimal empty menu when activated. Additionally, this being a primitive components, it is the consumer who should make sure the component is used correctly.

Thanks for raising a PR but I don't believe this is the component or the library's problem to solve. I will let others chime in as well before deciding how to move ahead.

@ashwin-pc
Copy link
Member

My personal opinion is that a design system is supposed to abstract away the complexity of managing the UI for a developer. @AMoo-Miki what you're proposing puts the responsibility back on the developer to handle the case where there are no alternate actions. While this is simple enough to do, it goes against why we use UI libraries in the first place. The more heavy lifting the UI library can do for you, the less the developer needs to think when they use the library and the less chances there are for inconsistent patterns to show up.

@AMoo-Miki
Copy link
Collaborator

I love making people's lives easier and I love cohesion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants