From 70253066d561018a7472345d6fba2211c52632d3 Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Fri, 10 Jan 2025 16:11:18 +0300 Subject: [PATCH] Fix #6008: Tooltip - stuck when several tooltips and targets are used together (#7590) Co-authored-by: Artem Andreev --- components/lib/tooltip/Tooltip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/lib/tooltip/Tooltip.js b/components/lib/tooltip/Tooltip.js index abfd2ed020..654d3d5e3a 100644 --- a/components/lib/tooltip/Tooltip.js +++ b/components/lib/tooltip/Tooltip.js @@ -219,11 +219,13 @@ export const Tooltip = React.memo( ZIndexUtils.clear(elementRef.current); DomHandler.removeClass(elementRef.current, 'p-tooltip-active'); - setVisibleState(false); sendCallback(props.onHide, { originalEvent: e, target: currentTargetRef.current }); }); } } + + // handles the case when visibleState change from mouseenter was queued and mouseleave handler was called earlier than queued re-render + setVisibleState(false); }; const align = (target, coordinate, position) => {