We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<ChevronRight />
The <ChevronRight /> icon is always displayed in the sidebar menu, even when a menu item does not contain sub-items.
This is misleading to users as it suggests a clickable submenu exists when it does not.
The <ChevronRight /> icon should only be displayed for menu items that contain sub-items.
i.e., when mainItem.items exists and has a length greater than 1.
mainItem.items
1
A fix has been implemented to conditionally render the <ChevronRight /> icon based on the presence of sub-items in the merge request:
MR: feat (next): Added <ChevronRight />'s render condition, based on mainItem.items.length
mainItem.items.length
shadcn-svelte@next add sidebar-07
shadcn-svelte@next add sidebar-08
Simply remove the navMain' s sub-items in the [ app-sidebar.svelte ]
navMain
app-sidebar.svelte
↳ (src/lib/components/app-sidebar.svelte)
// This is sample data. const data = { user: { name: 'shadcn', email: '[email protected]', avatar: '/avatars/shadcn.jpg' }, teams: [ { name: 'Acme Inc', logo: GalleryVerticalEnd, plan: 'Enterprise' }, { name: 'Acme Corp.', logo: AudioWaveform, plan: 'Startup' }, { name: 'Evil Corp.', logo: Command, plan: 'Free' } ], navMain: [ { title: 'Playground', url: '#', icon: SquareTerminal, isActive: true, items: [ // { title: 'History', url: '#' }, // { title: 'Starred', url: '#' }, // { title: 'Settings', url: '#' } ] // The rest of the code };
System: OS: macOS 14.6.1 CPU: (10) arm64 Apple M1 Pro Memory: 67.16 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm bun: 1.1.34 - /opt/homebrew/bin/bun Browsers: Brave Browser: 113.1.51.118 Chrome: 131.0.6778.86 Safari: 17.6 npmPackages: @sveltejs/kit: ^2.8.1 => 2.8.1 bits-ui: ^1.0.0-next.58 => 1.0.0-next.58 lucide-svelte: ^0.456.0 => 0.456.0 mode-watcher: ^0.4.1 => 0.4.1 svelte: ^5.2.2 => 5.2.2
annoyance
The text was updated successfully, but these errors were encountered:
next
No branches or pull requests
Describe the bug
Current Behavior:
The
<ChevronRight />
icon is always displayed in the sidebar menu, even when a menu item does not contain sub-items.Expected Behavior:
The
<ChevronRight />
icon should only be displayed for menu items that contain sub-items.Implementation:
A fix has been implemented to conditionally render the
<ChevronRight />
icon based on the presence of sub-items in the merge request:Reproduction
Blocks:
shadcn-svelte@next add sidebar-07
shadcn-svelte@next add sidebar-08
Simply remove the
navMain
' s sub-items in the [app-sidebar.svelte
]System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: