tooltip icon indicating copy to clipboard operation
tooltip copied to clipboard

Tooltip is not triggered when child is component.

Open OurMajesty opened this issue 6 years ago • 7 comments

When child of RcTooltip is some component, then tooltip is not triggered. BTW, Ant Design's Tooltip, using RcTooltip too, having the same problem.

CodeSandbox link to reproduce: https://codesandbox.io/s/still-browser-hwdgm

OurMajesty avatar Sep 11 '20 10:09 OurMajesty

Hi. @OurMajesty you should use all props from child component. I've fixed your example. https://codesandbox.io/s/blazing-meadow-xbbi1?file=/index.js

klamath avatar Sep 30 '20 13:09 klamath

@klamath I don't see any differences in your example, did you forget to save changes?

OurMajesty avatar Sep 30 '20 13:09 OurMajesty

Yeah )

klamath avatar Sep 30 '20 13:09 klamath

function Comp(props) { return <span {...props}>{props.children}</span>; }

klamath avatar Sep 30 '20 13:09 klamath

So there is onMouseEnter and onMouseLeave props, which should be forwarded to inner element.
I wonder, should this be mentioned in docs.

OurMajesty avatar Sep 30 '20 13:09 OurMajesty

There is other events as well. Docs link

klamath avatar Sep 30 '20 13:09 klamath

Oh, I see, how I missed it.

OurMajesty avatar Sep 30 '20 13:09 OurMajesty