Skip to content

Commit 7f25b3a

Browse files
authored
fix(useDraggable): draggable component not work with container (#4192)
1 parent aa5e35d commit 7f25b3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/useDraggable/component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ export const UseDraggable = /* #__PURE__ */ defineComponent<UseDraggableProps>({
3636
'onEnd',
3737
'disabled',
3838
'buttons',
39+
'containerElement',
3940
] as unknown as undefined,
4041
setup(props, { slots }) {
4142
const target = ref()
4243
const handle = computed(() => props.handle ?? target.value)
44+
const containerElement = computed(() => props.containerElement as (HTMLElement | SVGElement | null | undefined) ?? undefined)
4345
const disabled = computed(() => !!props.disabled)
4446
const storageValue = props.storageKey && useStorage(
4547
props.storageKey,
@@ -65,6 +67,7 @@ export const UseDraggable = /* #__PURE__ */ defineComponent<UseDraggableProps>({
6567
initialValue,
6668
onEnd,
6769
disabled,
70+
containerElement,
6871
}))
6972

7073
return () => {

0 commit comments

Comments
 (0)