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

Menu: separators cannot be hidden #7261

Closed
inad9300 opened this issue Sep 27, 2024 · 2 comments · Fixed by #7263
Closed

Menu: separators cannot be hidden #7261

inad9300 opened this issue Sep 27, 2024 · 2 comments · Fixed by #7263
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@inad9300
Copy link
Contributor

inad9300 commented Sep 27, 2024

Describe the bug

If you are displaying some menu items conditionally, you don't want to end up with potentially a bunch of separators separating nothing but empty space. Separators should be allowed to be hidden too.

<Menu model={[
  { label: 'Hi' },
  { separator: true },
  { label: 'Not here', visible: false },
  { separator: true, visible: false }, // `visible` flag ignored.
  { label: 'Bye' }
]} />

Reproducer

https://stackblitz.com/edit/vitejs-vite-hshelu?file=src%2FApp.tsx

@inad9300 inad9300 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 27, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 27, 2024
@melloware melloware self-assigned this Sep 27, 2024
@melloware melloware added this to the 10.8.4 milestone Sep 27, 2024
@blan19
Copy link

blan19 commented Sep 27, 2024

According to documentation, it appears that the 'visible' property of MenuItem can be used to set a hides for all menu item, including sub menu, separator, and menu items.

@melloware
Copy link
Member

Yep this should be fixed. Looking at it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants