From 38190f81cafb65e322f8bcb40ecce15fe30a2a38 Mon Sep 17 00:00:00 2001 From: Artem Andreev Date: Fri, 10 Jan 2025 09:25:56 +0300 Subject: [PATCH] Fix #6008: Tooltip - stuck when several tooltips and targets are used together --- 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) => {