Skip to content

Commit

Permalink
fix(tooltip): aria-describedby missing at first (#734)
Browse files Browse the repository at this point in the history
* fix(tooltip): fix aria-describedby

* chore: move useId trigger

---------

Co-authored-by: zernonia <zernonia@gmail.com>
  • Loading branch information
remonke and zernonia committed Mar 7, 2024
1 parent c51fa68 commit 311c400
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/radix-vue/src/Tooltip/TooltipContentImpl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { VNode } from 'vue'
import type { PrimitiveProps } from '@/Primitive'
import type { PopperContentProps } from '@/Popper'
import { useForwardExpose, useId } from '@/shared'
import { useForwardExpose } from '@/shared'
export type TooltipContentImplEmits = {
/** Event handler called when focus moves to the destructive action after opening. It can be prevented by calling `event.preventDefault` */
Expand Down Expand Up @@ -61,7 +61,6 @@ const props = withDefaults(defineProps<TooltipContentImplProps>(), {
const emits = defineEmits<TooltipContentImplEmits>()
const rootContext = injectTooltipRootContext()
rootContext.contentId ||= useId(undefined, 'radix-vue-tooltip-content')
const { forwardRef } = useForwardExpose()
const slot = useSlots()
Expand Down
4 changes: 3 additions & 1 deletion packages/radix-vue/src/Tooltip/TooltipTrigger.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { PrimitiveProps } from '@/Primitive'
import { useForwardExpose } from '@/shared'
import { useForwardExpose, useId } from '@/shared'
export type TooltipTriggerDataState =
| 'closed'
Expand All @@ -25,6 +25,8 @@ const props = withDefaults(defineProps<TooltipTriggerProps>(), {
const rootContext = injectTooltipRootContext()
const providerContext = injectTooltipProviderContext()
rootContext.contentId ||= useId(undefined, 'radix-vue-tooltip-content')
const { forwardRef, currentElement: triggerElement } = useForwardExpose()
const isPointerDown = ref(false)
Expand Down

0 comments on commit 311c400

Please sign in to comment.