Skip to content

Commit

Permalink
fix(NcAvatar): Fix invalid interactive content in avatar
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jan 25, 2024
1 parent cfbb197 commit 1ee2040
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,14 @@ export default {
type: Number,
default: 0,
},
/**
* The `inert` attribute for the menu toggle button
*/
inert: {
type: Boolean,
default: false,
},
},
emits: [
Expand Down Expand Up @@ -1416,6 +1424,7 @@ export default {
attrs: {
'aria-label': this.menuName ? null : this.ariaLabel,
'aria-controls': this.opened ? this.randomId : null,
inert: this.inert,
},
on: {
focus: this.onFocus,
Expand Down
12 changes: 8 additions & 4 deletions src/components/NcAvatar/NcAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ export default {

<!-- Contact menu -->
<!-- We show a button if the menu is not loaded yet. -->
<NcButton v-if="hasMenu && !menu.length"
:aria-label="t('Open contact menu')"
<NcButton v-if="hasMenu && menu.length === 0"
type="tertiary-no-background"
class="action-item action-item__menutoggle">
class="action-item action-item__menutoggle"
inert>
<template #icon>
<NcLoadingIcon v-if="contactsMenuLoading" />
<DotsHorizontal v-else :size="20" />
Expand All @@ -151,7 +151,8 @@ export default {
manual-open
type="tertiary-no-background"
:container="menuContainer"
:open="contactsMenuOpenState">
:open="contactsMenuOpenState"
inert>
<NcActionLink v-for="(item, key) in menu"
:key="key"
:href="item.href"
Expand Down Expand Up @@ -738,6 +739,9 @@ export default {
&--with-menu {
cursor: pointer;
&:deep * {
cursor: inherit;
}
.action-item {
position: absolute;
top: 0;
Expand Down

0 comments on commit 1ee2040

Please sign in to comment.