Skip to content

Commit 613b214

Browse files
fix: setTemplateRef
1 parent 4c0bee9 commit 613b214

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

packages/vue-primitives/src/aspect-ratio/AspectRatio.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ defineExpose({
3232
>
3333
<Primitive
3434
:ref="(el: any) => {
35-
elRef = (el?.$el ?? el) || undefined
35+
const node = (el?.$el ?? el)
36+
elRef = node?.hasAttribute ? node : undefined
3637
}"
3738
:as="as"
3839
:as-child="asChild"

packages/vue-primitives/src/collapsible/CollapsibleContent.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,17 @@ watch(
7878
<Primitive
7979
:id="context.contentId"
8080
:ref="(el: any) => {
81-
elRef = (el?.$el ?? el) || undefined
81+
const node = (el?.$el ?? el)
82+
elRef = node?.hasAttribute ? node : undefined
8283
}"
8384
:as="as"
8485
:as-child="asChild"
8586
:data-state="getState(context.open.value)"
8687
:data-disabled="context.disabled?.value ? '' : undefined"
8788
:hidden="!isOpen"
8889
:style="{
89-
[`--oku-collapsible-content-height`]: `${height}px`,
90-
[`--oku-collapsible-content-width`]: `${width}px`,
90+
[`--radix-collapsible-content-height`]: `${height}px`,
91+
[`--radix-collapsible-content-width`]: `${width}px`,
9192
}"
9293
>
9394
<slot v-if="isOpen" />

packages/vue-primitives/src/primitive/Primitive.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ defineExpose({
2626
<component
2727
:is="asChild ? Slot : as"
2828
:ref="(el: any) => {
29-
elRef = (el?.$el ?? el) || undefined
29+
const node = (el?.$el ?? el)
30+
elRef = node?.hasAttribute ? node : undefined
3031
}"
3132
>
3233
<slot />

packages/vue-primitives/src/roving-focus/RovingFocusGroup.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ provideRovingFocusContext({
9292
<template>
9393
<Primitive
9494
:ref="(el: any) => {
95-
elRef = (el?.$el ?? el) || undefined
95+
const node = (el?.$el ?? el)
96+
elRef = node?.hasAttribute ? node : undefined
9697
}"
9798
:as="as"
9899
:as-child="asChild"

packages/vue-primitives/src/roving-focus/RovingFocusItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ const onKeydown = composeEventHandlers<KeyboardEvent>((event) => {
106106
<template>
107107
<Primitive
108108
:ref="(el: any) => {
109-
elRef = (el?.$el ?? el) || undefined
109+
const node = (el?.$el ?? el)
110+
elRef = node?.hasAttribute ? node : undefined
110111
}"
111112
:as="as"
112113
:as-child="asChild"

0 commit comments

Comments
 (0)