You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, I'm facing an issue with the active state not updating when clicking a menu item when the sidebar is open, i.e., not collapsed.
When the item is clicked, the active state remains unchanged. It only updates when not using inertia to navigate between routes.
For technical reasons I can't update to vue3 and thus I'm forced to use vue2 branch with Laravel and Inertia. This is an except from my current implementation:
As you can see, I tried with no success to use a "key" so that the component updates when the menu item is clicked. But sort of works, but the active state will be set for the last route, not current. Do you guys have any ideas how can I solve this?
The text was updated successfully, but these errors were encountered:
Hi @yaminncco, thank you so much.
I ended up sticking to using the key to update the component. For some reason the key was being changed before the inertia.visit call, which was causing the mismatch. So I came to know that Inertia provides a onSuccess handler which I made use as so:
Hi guys, I'm facing an issue with the active state not updating when clicking a menu item when the sidebar is open, i.e., not collapsed.
When the item is clicked, the active state remains unchanged. It only updates when not using inertia to navigate between routes.
For technical reasons I can't update to vue3 and thus I'm forced to use vue2 branch with Laravel and Inertia. This is an except from my current implementation:
As you can see, I tried with no success to use a "key" so that the component updates when the menu item is clicked. But sort of works, but the active state will be set for the last route, not current. Do you guys have any ideas how can I solve this?
The text was updated successfully, but these errors were encountered: