fix: remove old pointer-down function after radix-vue update

This commit is contained in:
hrynevych.romann 2024-02-14 21:43:03 +02:00
parent 8dcc3564c3
commit 20b8433b7d
2 changed files with 1 additions and 10 deletions

View File

@ -24,7 +24,7 @@ interface DataTableFacetedFilter {
options: { options: {
label: string label: string
value: string value: string
icon?: Component icon: Component
}[] }[]
} }

View File

@ -9,20 +9,12 @@ import {
useEmitAsProps, useEmitAsProps,
} from 'radix-vue' } from 'radix-vue'
import { X } from 'lucide-vue-next' import { X } from 'lucide-vue-next'
import type { PointerDownOutsideEvent } from 'radix-vue/dist/DismissableLayer'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<DialogContentProps & { class?: string }>() const props = defineProps<DialogContentProps & { class?: string }>()
const emits = defineEmits<DialogContentEmits>() const emits = defineEmits<DialogContentEmits>()
const emitsAsProps = useEmitAsProps(emits) const emitsAsProps = useEmitAsProps(emits)
function handlePointerDown(event: PointerDownOutsideEvent) {
const originalEvent = event.detail.originalEvent
// Ignore click events on the scrollbar.
if (originalEvent.offsetX > originalEvent.target?.clientWidth || originalEvent.offsetY > originalEvent.target?.clientHeight)
event.preventDefault()
}
</script> </script>
<template> <template>
@ -38,7 +30,6 @@ function handlePointerDown(event: PointerDownOutsideEvent) {
) )
" "
v-bind="{ ...props, ...emitsAsProps }" v-bind="{ ...props, ...emitsAsProps }"
@pointer-down-outside="handlePointerDown"
> >
<slot /> <slot />