Skip to content

Commit

Permalink
Merge pull request #731 from lucianmurmurache/fix/close-menu-on-route…
Browse files Browse the repository at this point in the history
…-change

fix: close sidebar on route change
  • Loading branch information
andrewtavis authored Mar 3, 2024
2 parents 6514e66 + f342851 commit b7d8f6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/components/sidebar/right/SidebarRight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<script setup lang="ts">
import { onClickOutside } from "@vueuse/core";
import { watch } from "vue";
const target = ref<HTMLElement | null>(null);
const menuOpen = ref(false);
Expand All @@ -41,5 +42,8 @@ const closeMenuState = () => {
menuOpen.value = false;
};
const route = useRoute();
watch(() => route.path, closeMenuState);
onClickOutside(target, closeMenuState, { ignore: [ignoreElRef] });
</script>

0 comments on commit b7d8f6f

Please sign in to comment.