Skip to content

Commit

Permalink
fix(VSpeedDial): forward menu slots
Browse files Browse the repository at this point in the history
fixes #19381
  • Loading branch information
KaelWD committed Mar 13, 2024
1 parent dbd7432 commit 46ed018
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions packages/vuetify/src/labs/VSpeedDial/VSpeedDial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ import { makeComponentProps } from '@/composables/component'
import { makeTransitionProps, MaybeTransition } from '@/composables/transition'

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

// Types
import type { OverlaySlots } from '@/components/VOverlay/VOverlay'

export const makeVSpeedDialProps = propsFactory({
...makeComponentProps(),
...makeVMenuProps({ offset: 8, minWidth: 0, location: 'top center' as const }),
...makeTransitionProps({ transition: 'fade-transition' }),
}, 'VSpeedDial')

export const VSpeedDial = genericComponent()({
export const VSpeedDial = genericComponent<OverlaySlots>()({
name: 'VSpeedDial',

props: makeVSpeedDialProps(),

setup (props, { slots }) {
const menuRef = ref<VMenu>()

useRender(() => {
const menuProps = VMenu.filterProps(props)

Expand All @@ -33,22 +39,28 @@ export const VSpeedDial = genericComponent()({
class={ props.class }
style={ props.style }
contentClass="v-speed-dial__content"
ref={ menuRef }
>
<VDefaultsProvider
defaults={{
VBtn: {
size: 'small',
},
}}
>
<MaybeTransition
appear
group
transition={ props.transition }
>
{ slots.default?.() }
</MaybeTransition>
</VDefaultsProvider>
{{
...slots,
default: slotProps => (
<VDefaultsProvider
defaults={{
VBtn: {
size: 'small',
},
}}
>
<MaybeTransition
appear
group
transition={ props.transition }
>
{ slots.default?.(slotProps) }
</MaybeTransition>
</VDefaultsProvider>
),
}}
</VMenu>
)
})
Expand Down

0 comments on commit 46ed018

Please sign in to comment.