Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Merge pull request #498 from storyblok/subtask/shape-57
Browse files Browse the repository at this point in the history
refactor(shape-57): remove the reference to showAvatar data in the SelectInner component
  • Loading branch information
emanuelgsouza authored Jan 12, 2024
2 parents 4002af1 + 0cb28b2 commit 15225b5
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/components/Select/components/SelectInner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/>
</div>

<div v-if="isAvatarVisible && showAvatar" class="sb-select-inner__avatar">
<div v-if="isAvatarVisible" class="sb-select-inner__avatar">
<SbAvatar
:src="avatarData.src"
size="small"
Expand Down Expand Up @@ -240,10 +240,6 @@ export default {
'remove-item-value',
],
data: () => ({
showAvatar: false,
}),
computed: {
dataTestid() {
return this.$attrs['data-testid'] || 'sb-select-inner'
Expand Down Expand Up @@ -318,8 +314,7 @@ export default {
this.hasValue &&
!this.multiple &&
!this.searchInputText.length &&
!this.isAvatarVisible &&
!this.showAvatar
!this.isAvatarVisible
)
},
Expand Down Expand Up @@ -430,16 +425,6 @@ export default {
},
watch: {
searchInputText(val) {
if (
this.avatarData &&
val === this.avatarData?.label &&
this.isAvatarVisible
) {
this.showAvatar = true
}
},
modelValue(val, oldVal) {
const isSameValue = JSON.stringify(val) === JSON.stringify(oldVal)
if (this.isSearchTextVisible && !isSameValue) {
Expand All @@ -448,14 +433,6 @@ export default {
}
return
}
if (this.isAvatarVisible) {
this.showAvatar = true
}
},
isAvatarVisible(val) {
this.showAvatar = val
},
},
Expand Down

0 comments on commit 15225b5

Please sign in to comment.