How to keep RadixUI Tooltip/Modal in dom
18:08 14 Jan 2024

I'm using RadixUI library (https://www.radix-ui.com/primitives/docs/components/tooltip) for my components. The problem is that I'd like to keep the content of my Tooltip in dom. Currently, it appears only on hover and is rendered in body element as a last child. What I'd like to obtain is that:

  1. Tooltip content is always kept in dom (for example with display: none style)
  2. Tooltip content is rendered inside my tooltip trigger or at least in a way that its possible to identify with which trigger its associated

EDIT Currently I have the following

    
      
        
          {label}
        
        
          {content}
        
      
    

The remaining drawback - closing animation does not work with hidden class. Is it possible to make it works?

javascript reactjs radix-ui