Skip to content

Commit

Permalink
fixup! Replace custom toolip with native one on Avatar component. Sho…
Browse files Browse the repository at this point in the history
…w valid value for aria-label every time.

Signed-off-by: julia.kirschenheuter <[email protected]>
  • Loading branch information
JuliaKirschenheuter committed Jan 26, 2023
1 parent 8caa2c6 commit 8a63c27
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/components/NcAvatar/NcAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
'avatardiv--unknown': userDoesNotExist,
'avatardiv--with-menu': hasMenu
}"
:title="title ? title : tooltip"
:title="tooltip"
:style="avatarStyle"
class="avatardiv popovermenu-wrapper"
:tabindex="hasMenu ? '0' : undefined"
Expand Down Expand Up @@ -324,17 +324,6 @@ export default {
default: null,
},

/**
* Declares a native tooltip when not null
*
* requires disableTooltip not to be set to true
* requires tooltipMessage not to be provided
*/
title: {
type: String,
default: null,
},

/**
* Declares username is not a user's name, when true.
* Prevents loading user's avatar from server and forces generating colored initials,
Expand All @@ -361,11 +350,6 @@ export default {
type: [String, Object, Element, Boolean],
default: 'body',
},

ariaLabel: {
type: String,
default: null,
},
},
data() {
return {
Expand All @@ -381,8 +365,8 @@ export default {
},
computed: {
avatarAriaLabel() {
if (!this.displayName) {
return t('Avatar')
if (!this.hasMenu) {
return
}
if (this.hasStatus && this.showUserStatus && this.showUserStatusCompact) {
return t('Avatar of {displayName}, {status}', { displayName: this.displayName ?? this.user, status: this.userStatus.status })
Expand Down

0 comments on commit 8a63c27

Please sign in to comment.