primitives icon indicating copy to clipboard operation
primitives copied to clipboard

Tooltip Content asChild crashes

Open adri1wald opened this issue 1 year ago • 3 comments

Bug report

The Tooltip Content component crashes with asChild.

Current Behavior

It crashes when I render anything with <TooltipPrimitive.Content asChild />.

Expected behavior

It does not crash.

Reproducible example

Can't get the tempalte to work

Suggested solution

Do not render <VisuallyHiddenContentContextProvider /> inside of a component that can be asChilded

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-tooltip 1.1.0
React n/a
Browser
Assistive tech
Node n/a
npm/yarn
Operating System

adri1wald avatar Jun 26 '24 12:06 adri1wald

Here is reproducible example:

Slightly modified (switched to react@rc and added asChild prop) official example for Tooltip.

CodeSandbox (hover over button and then see console)

OlegWock avatar Aug 01 '24 08:08 OlegWock

Same with Trigger

ryparker avatar Aug 08 '24 21:08 ryparker

➕ also hitting this issue.

alexfreska avatar Oct 07 '24 20:10 alexfreska