Skip to content

Commit

Permalink
Merge branch 'hotfix/profile-dropdown-close' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed Dec 16, 2024
2 parents 5e28093 + 3dc542b commit 0e067dc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/Topbar/ProfileDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template>
<UnnnicDropdown
ref="profileDropdown"
position="bottom-left"
class="dropdown"
:open="isProfileDropdownOpen"
@update:open="isProfileDropdownOpen = $event"
>
<template #trigger>
<section
Expand Down Expand Up @@ -89,6 +91,7 @@ import { computed, getCurrentInstance, ref } from 'vue';
import ProfilePictureDefault from './ProfilePictureDefault.vue';
import ProfileLanguageSelector from './ProfileLanguageSelector.vue';
import i18n from '@/utils/plugins/i18n.js';
import { onClickOutside } from '@vueuse/core';
import {
ORG_ROLE_ADMIN,
Expand All @@ -109,6 +112,16 @@ const keycloak = use('keycloak');
const photoWithError = ref(false);
const isProfileDropdownOpen = ref(false);
const profileDropdown = ref(null);
onClickOutside(
profileDropdown,
() => {
isProfileDropdownOpen.value = false;
},
{ detectIframe: true },
);
const firstName = computed(() => {
return getProfileProperty('first_name');
});
Expand Down

0 comments on commit 0e067dc

Please sign in to comment.