1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

Fixed: Links tooltip closing too quickly

This commit is contained in:
Mark McDowall 2024-09-02 16:04:37 -07:00 committed by Mark McDowall
parent 0e384ee3aa
commit 0b9a212f33

View File

@ -65,8 +65,7 @@ function Tooltip(props: TooltipProps) {
const handleMouseLeave = useCallback(() => { const handleMouseLeave = useCallback(() => {
// Still listen for mouse leave on mobile to allow clicks outside to close the tooltip. // Still listen for mouse leave on mobile to allow clicks outside to close the tooltip.
closeTimeout.current = window.setTimeout(() => {
setTimeout(() => {
setIsOpen(false); setIsOpen(false);
}, 100); }, 100);
}, [setIsOpen]); }, [setIsOpen]);
@ -111,18 +110,18 @@ function Tooltip(props: TooltipProps) {
); );
useEffect(() => { useEffect(() => {
const currentTimeout = closeTimeout.current;
if (updater.current && isOpen) { if (updater.current && isOpen) {
updater.current(); updater.current();
} }
});
useEffect(() => {
return () => { return () => {
if (currentTimeout) { if (closeTimeout.current) {
window.clearTimeout(currentTimeout); window.clearTimeout(closeTimeout.current);
} }
}; };
}); }, []);
return ( return (
<Manager> <Manager>