Navlist groups don't auto expand on active navlist items #128
Replies: 4 comments
-
@idealerror thanks for reporting! I've converted this to a feature request for now, while it's not ideal it could be nice to have. |
Beta Was this translation helpful? Give feedback.
-
@idealerror thanks for this. I couldn't get expanded true/false to work. I was missing the colon, but you also upgraded what I wanted. Thanks <flux:navlist.group expandable heading="Tools" :expanded="(request()->is('tools/*'))">
@livewire('components.children', ['post'=> 3, 'title'=>'Tools', 'is_menu'=>true])
</flux:navlist.group> |
Beta Was this translation helpful? Give feedback.
-
I have solved this by adding the currentRouteNames of all children, but will check your workaround. <flux:navlist.group expandable :expanded="in_array(Route::currentRouteName(),['route1','route2'])" heading="My NavList Header" class="hidden lg:grid">
<flux:navlist.item icon="home-modern" href="{{ route('route1') }}">Item 1</flux:navlist.item>
<flux:navlist.item icon="document-check" href="{{ route('route2') }}">Item2</flux:navlist.item>
</flux:navlist.group> |
Beta Was this translation helpful? Give feedback.
-
I have spent literally hours trying to make this work on a multi group dropdown menu and was getting nowhere .. every "refresh" (in my otherwise single page application) caused the menus to reset ... and then I discovered @persist / @endpersist! Wrap the nested foreach with that and job done! |
Beta Was this translation helpful? Give feedback.
-
By default,
<flux:navlist.group>
are:expanded="true"
.If set to
false
and a link within the group is active, the item is no longer visible as the group is not expanded.Can there be logic added to the navlist group to detect if a child item is active and automatically expand the group or is this too complicated and we should account for this ourselves on the group using
:expanded="(request()->is('/') || request()->is('/test'))"
or similar?Separately, line 25 of navlist.group has a typo with double quotes:
<div class="block space-y-[2px]"">
Beta Was this translation helpful? Give feedback.
All reactions