Skip to content

Commit da1b148

Browse files
committed
fix: default tooltip to true
1 parent 2c1724d commit da1b148

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Tooltip.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function Tooltip<TDatum>(): React.ReactPortal | null {
5050
const [focusedDatum] = useFocusedDatumAtom()
5151
const latestFocusedDatum = useLatestWhen(focusedDatum, !!focusedDatum)
5252

53-
const preTooltipOptions = getOptions().tooltip
53+
const preTooltipOptions = getOptions().tooltip ?? true
5454

5555
const secondaryAxis =
5656
secondaryAxes.find(d => d.id === latestFocusedDatum?.secondaryAxisId) ??
@@ -162,7 +162,9 @@ export default function Tooltip<TDatum>(): React.ReactPortal | null {
162162
},
163163
})
164164

165-
return portalEl
165+
const show = !!preTooltipOptions
166+
167+
return show && portalEl
166168
? ReactDOM.createPortal(
167169
<animated.div style={springProps}>
168170
<div

0 commit comments

Comments
 (0)