File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/eds-core-react/src/components/Tooltip Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 77 cloneElement ,
88 useMemo ,
99 useEffect ,
10+ ReactNode ,
1011} from 'react'
1112import { createPortal } from 'react-dom'
1213import styled from 'styled-components'
@@ -81,7 +82,7 @@ export type TooltipProps = {
8182 /** Tooltip placement relative to anchor */
8283 placement ?: Placement
8384 /** Tooltip title */
84- title ?: string
85+ title ?: ReactNode
8586 /** Tooltip anchor element */
8687 children : React . ReactElement & React . RefAttributes < HTMLElement >
8788 /** Delay in ms, default 100 */
@@ -90,7 +91,7 @@ export type TooltipProps = {
9091 * @default document.body
9192 * */
9293 portalContainer ?: HTMLElement
93- } & HTMLAttributes < HTMLDivElement >
94+ } & Omit < HTMLAttributes < HTMLDivElement > , 'title' >
9495
9596export const Tooltip = forwardRef < HTMLDivElement , TooltipProps > (
9697 function Tooltip (
@@ -107,8 +108,8 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
107108 ) {
108109 const arrowRef = useRef < HTMLDivElement > ( null )
109110 const [ open , setOpen ] = useState ( false )
110- const shouldOpen = title !== '' && typeof document !== 'undefined'
111111 const { rootElement } = useEds ( )
112+ const shouldOpen = Boolean ( title ) && typeof document !== 'undefined'
112113
113114 const {
114115 x,
You can’t perform that action at this time.
0 commit comments