From a86970a36c29b9fb0928803a6fc59d8d16ae408f Mon Sep 17 00:00:00 2001 From: Melloware Date: Thu, 23 May 2024 07:40:45 -0400 Subject: [PATCH] Fix #6648: Tooltip default position to 'right' if undefined (#6651) --- components/lib/tooltip/Tooltip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/tooltip/Tooltip.js b/components/lib/tooltip/Tooltip.js index 489ea2709c..d108f6a537 100644 --- a/components/lib/tooltip/Tooltip.js +++ b/components/lib/tooltip/Tooltip.js @@ -12,7 +12,7 @@ export const Tooltip = React.memo( const context = React.useContext(PrimeReactContext); const props = TooltipBase.getProps(inProps, context); const [visibleState, setVisibleState] = React.useState(false); - const [positionState, setPositionState] = React.useState(props.position); + const [positionState, setPositionState] = React.useState(props.position || 'right'); const [classNameState, setClassNameState] = React.useState(''); const metaData = { props, @@ -449,7 +449,7 @@ export const Tooltip = React.memo( bindWindowResizeListener(); bindOverlayScrollListener(); } else { - setPositionState(props.position); + setPositionState(props.position || 'right'); setClassNameState(''); currentTargetRef.current = null; containerSize.current = null;