Skip to content

Commit

Permalink
fix(VBtn): apply center ripple when using the icon prop (#19577)
Browse files Browse the repository at this point in the history
fixes #17376
  • Loading branch information
johnleider authored Apr 10, 2024
1 parent ddfe69a commit e1e6065
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/vuetify/src/components/VBtn/VBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { genOverlays, makeVariantProps, useVariant } from '@/composables/variant
import { Ripple } from '@/directives/ripple'

// Utilities
import { computed } from 'vue'
import { computed, withDirectives } from 'vue'
import { genericComponent, propsFactory, useRender } from '@/util'

// Types
Expand Down Expand Up @@ -89,8 +89,6 @@ export const makeVBtnProps = propsFactory({
export const VBtn = genericComponent<VBtnSlots>()({
name: 'VBtn',

directives: { Ripple },

props: makeVBtnProps(),

emits: {
Expand Down Expand Up @@ -163,7 +161,7 @@ export const VBtn = genericComponent<VBtnSlots>()({
(!group || link.isActive?.value)
)

return (
return withDirectives(
<Tag
type={ Tag === 'a' ? undefined : 'button' }
class={[
Expand Down Expand Up @@ -203,11 +201,6 @@ export const VBtn = genericComponent<VBtnSlots>()({
disabled={ isDisabled.value || undefined }
href={ link.href.value }
tabindex={ props.loading ? -1 : undefined }
v-ripple={[
!isDisabled.value && props.ripple,
null,
props.icon ? ['center'] : null,
]}
onClick={ onClick }
value={ valueAttr.value }
>
Expand Down Expand Up @@ -289,7 +282,13 @@ export const VBtn = genericComponent<VBtnSlots>()({
)}
</span>
)}
</Tag>
</Tag>,
[[
Ripple,
!isDisabled.value && !!props.ripple,
'',
{ center: !!props.icon },
]]
)
})

Expand Down

0 comments on commit e1e6065

Please sign in to comment.