Skip to content
Discussion options

You must be logged in to vote

I fixed it using this code:

import { Inertia } from "@inertiajs/inertia";

const settingsNavActive = ref(false);

Inertia.on("navigate", () => {
  settingsNavActive.value =
    route().current("admin.settings.*");
});

<PopoverButton :class="settingsNavActive ? 'active-classes' : 'non-active-classes'">
  <span>Settings</span>
  <ChevronDownIcon class="h-5 w-5 ml-2" aria-hidden="true" />
</PopoverButton>

Also, popover is not auto-closed when using persistent layouts, so there is one more "fix" to close it on route change:

<PopoverPanel v-slot="{ close }">
  <!-- html to show links -->
  <Link :href="route('admin.settings.some-page')" @click="close()">Some settings page</Link>
</PopoverPan…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kskrlinnorth2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant