2929import {isEmptySlot , isNumeric , toFloat } from ' ../../utils'
3030import type {BAvatarGroupParentData } from ' ../../types/components'
3131import {computed , inject , StyleValue , toRef , useSlots } from ' vue'
32- import type {Booleanish , ColorVariant , TextColorVariant } from ' ../../types'
32+ import type {Booleanish , ButtonType , ColorVariant , TextColorVariant } from ' ../../types'
3333import {injectionKey } from ' ./BAvatarGroup.vue'
3434import {useBooleanish } from ' ../../composables'
3535
@@ -42,7 +42,7 @@ interface BAvatarProps {
4242 badgeTop? : Booleanish
4343 badgeVariant? : ColorVariant
4444 button? : Booleanish
45- buttonType? : string
45+ buttonType? : ButtonType
4646 disabled? : Booleanish
4747 icon? : string
4848 rounded? : boolean | string
@@ -117,6 +117,7 @@ const computedRounded = computed<string | boolean>(() =>
117117)
118118
119119const attrs = computed (() => ({
120+ ' type' : buttonBoolean .value ? props .buttonType : undefined ,
120121 ' aria-label' : props .ariaLabel || null ,
121122 ' disabled' : disabledBoolean .value || null ,
122123}))
@@ -184,8 +185,7 @@ const marginStyle = computed(() => {
184185 return value ? {marginLeft: value , marginRight: value } : {}
185186})
186187
187- // TODO this is incorrect. If buttonType is 'submit' and prop button is true, it will break the component
188- const tag = computed <string >(() => (buttonBoolean .value ? props .buttonType : ' span' ))
188+ const tag = computed <' button' | ' span' >(() => (buttonBoolean .value ? ' button' : ' span' ))
189189const tagStyle = computed (() => ({
190190 ... marginStyle .value ,
191191 width: computedSize .value ,
0 commit comments