Skip to content

Commit

Permalink
chore: replace with usePrimitveElement
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Sep 25, 2024
1 parent f62a469 commit 405d4e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/radix-vue/src/RovingFocus/RovingFocusItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export interface RovingFocusItemProps extends PrimitiveProps {
</script>

<script setup lang="ts">
import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue'
import { computed, nextTick, onMounted, onUnmounted } from 'vue'
import { injectRovingFocusGroupContext } from './RovingFocusGroup.vue'
import { Primitive } from '@/Primitive'
import { Primitive, usePrimitiveElement } from '@/Primitive'
import { focusFirst, getFocusIntent, wrapArray } from './utils'
import { useId } from '@/shared'
import { CollectionItem, useCollection } from '@/Collection'
Expand All @@ -31,8 +31,8 @@ const isCurrentTabStop = computed(
const { getItems } = useCollection()
const elRef = ref()
const rootNode = computed<Document | ShadowRoot>(() => elRef.value?.$el.getRootNode())
const { primitiveElement, currentElement } = usePrimitiveElement()
const rootNode = computed(() => currentElement.value?.getRootNode() as Document | ShadowRoot)
onMounted(() => {
if (props.focusable)
Expand Down Expand Up @@ -87,7 +87,7 @@ function handleKeydown(event: KeyboardEvent) {
<template>
<CollectionItem>
<Primitive
ref="elRef"
ref="primitiveElement"
:tabindex="isCurrentTabStop ? 0 : -1"
:data-orientation="context.orientation.value"
:data-active="active"
Expand Down

0 comments on commit 405d4e8

Please sign in to comment.