aymanalhattami / filament-page-with-sidebar

Organize pages in the sidebar in order to make navigation between pages more comfortable.
https://github.com/aymanalhattami/filament-page-with-sidebar
MIT License
175 stars 22 forks source link

The active item loses the activity indication when working with components #36

Closed krio-rogue closed 6 months ago

krio-rogue commented 6 months ago

Package version : 2.4.2

On first open page, menu item has indication "active", on work with any components (table filters, sorting, trigger button actions) menu item loses indication.

->isActiveWhen(function () {
    return request()->routeIs(static::getRouteBaseName() . '.activities.user');
})

Filament package has "Sub Navigation", and when you update components, its state remains unchanged. This can be clearly seen if you use, for example, this code

->label(function() {
    return request()->route()->getName() . ' | ' . microtime(true);
})

Steps to reproduce Repo : https://github.com/aymanalhattami/filament-page-with-sidebar-project Url : http://127.0.0.1:8000/admin/users/1/activities/user Open page "User Activities", menu item "User Activities" has indication "active". On click 'View' button on any record, a modal popup will be open. Close modal popup. Current menu item "User Activities" without indication "active".

aymanalhattami commented 6 months ago

It works

https://github.com/aymanalhattami/filament-page-with-sidebar/assets/34315778/8be5be26-997c-42ee-997f-bb25fb3e5e5e

krio-rogue commented 6 months ago

@aymanalhattami https://github.com/aymanalhattami/filament-page-with-sidebar-project/blob/main/app/Filament/Resources/UserResource.php not enabled sidebarNavigation mode. Just checked the code in the repository (https://github.com/aymanalhattami/filament-page-with-sidebar-project) , when sidebar mode is enabled, the indication is preserved. When top is enabled, the indication is lost.