Tooltip hover simulation not working in Chrome and Firefox #3757
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@xiaoxiaobt the DevTools to inspect the tooltip in DevTools: 1. force it open via props: <Tooltip.Root open={true}>
<Tooltip.Trigger>Hover me</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content>Tooltip text</Tooltip.Content>
</Tooltip.Portal>
</Tooltip.Root>2. tab-focus the trigger. 3. for testing (e.g., with Testing Library), use const trigger = screen.getByRole('button');
await userEvent.hover(trigger);
expect(screen.getByText('Tooltip text')).toBeVisible();the |
Beta Was this translation helpful? Give feedback.

@xiaoxiaobt the DevTools
:hovertoggle only applies the CSS pseudo-class, it doesn't fire JavaScript events. radix tooltip usesonPointerMove/onPointerLeaveexclusively for open/close logic (tooltip.tsx), not CSS:hover. so forcing:hovervia DevTools has no effect.to inspect the tooltip in DevTools:
1. force it open via props:
2. tab-focus the trigger.
onFocusalso opens the tooltip (for accessibility), so pressing Tab to focus the trigger button works. combine with Chrome's "Emulate a focused page" (Renderi…