parent
647e9c11c1
commit
50e85fe970
@ -0,0 +1,16 @@ |
|||||||
|
import ReactTooltip from 'react-tooltip' //https://wwayne.github.io/react-tooltip/
|
||||||
|
|
||||||
|
function ExpandTooltip(p) { |
||||||
|
return <><span data-tip data-for={p.id}>{p.children}</span><ReactTooltip id={p.id} className="xTooltip" overridePosition={ ( |
||||||
|
{ left, top }, |
||||||
|
currentEvent, currentTarget, node) => { |
||||||
|
const d = document.documentElement; |
||||||
|
left = Math.min(d.clientWidth - node.clientWidth, left); |
||||||
|
top = Math.min(d.clientHeight - node.clientHeight, top); |
||||||
|
left = Math.max(0, left); |
||||||
|
top = Math.max(0, top); |
||||||
|
return { top, left } |
||||||
|
} }>{p.tooltip}</ReactTooltip></> |
||||||
|
} |
||||||
|
|
||||||
|
export {ExpandTooltip} |
Loading…
Reference in new issue