Skip to content

Commit

Permalink
fix(Icon): fix jest error
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasrat committed Jan 25, 2024
1 parent 837aad9 commit 483b98a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/vuetify/src/components/VIcon/VIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export const VIcon = genericComponent()({
const { sizeClasses } = useSize(props)
const { textColorClasses, textColorStyles } = useTextColor(toRef(props, 'color'))

const hasClickEvent = inject<() => boolean>('hasClickEvent')
// handle undefined
const safeHasClickEvent = hasClickEvent ?? (() => false)
const hasClickEvent = inject<() => boolean>('hasClickEvent', () => false)

useRender(() => {
const slotValue = slots.default?.()
Expand Down Expand Up @@ -76,9 +74,9 @@ export const VIcon = genericComponent()({
textColorStyles.value,
props.style,
]}
role={ safeHasClickEvent() || attrs.onClick ? 'button' : undefined }
aria-hidden={ !safeHasClickEvent() || !attrs.onClick }
tabindex={ safeHasClickEvent() ? '0' : undefined }
role={ hasClickEvent() || attrs.onClick ? 'button' : undefined }
aria-hidden={ !hasClickEvent || !attrs.onClick }
tabindex={ hasClickEvent() ? '0' : undefined }
>
{ slotValue }
</iconData.value.component>
Expand Down

0 comments on commit 483b98a

Please sign in to comment.