Skip to content

Commit

Permalink
fix(VOverlay): move targetRef out of props
Browse files Browse the repository at this point in the history
fixes #19685
  • Loading branch information
KaelWD committed Apr 25, 2024
1 parent 2f32868 commit 5e40cc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/vuetify/src/components/VOverlay/VOverlay.tsx
Expand Up @@ -46,7 +46,10 @@ import {
} from '@/util'

// Types
import type { PropType, Ref } from 'vue'
import type {
ComponentPublicInstance, PropType,
Ref,
} from 'vue'
import type { BackgroundColorData } from '@/composables/color'

interface ScrimProps {
Expand Down Expand Up @@ -74,7 +77,7 @@ function Scrim (props: ScrimProps) {

export type OverlaySlots = {
default: { isActive: Ref<boolean> }
activator: { isActive: boolean, props: Record<string, any> }
activator: { isActive: boolean, props: Record<string, any>, targetRef: Ref<ComponentPublicInstance<any> | HTMLElement> }
}

export const makeVOverlayProps = propsFactory({
Expand Down Expand Up @@ -268,9 +271,9 @@ export const VOverlay = genericComponent<OverlaySlots>()({
<>
{ slots.activator?.({
isActive: isActive.value,
targetRef,
props: mergeProps({
ref: activatorRef,
targetRef,
}, activatorEvents.value, props.activatorProps),
})}

Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VOverlay/useActivator.tsx
Expand Up @@ -237,7 +237,7 @@ export function useActivator (
})
})

const targetRef = ref<HTMLElement>()
const targetRef = ref<ComponentPublicInstance<any> | HTMLElement>()
const target = computed(() => {
if (props.target === 'cursor' && cursorTarget.value) return cursorTarget.value
if (targetRef.value) return refElement(targetRef.value)
Expand Down

0 comments on commit 5e40cc8

Please sign in to comment.