diff --git a/src/components/Tooltip/EducationalTooltip/BaseEducationalTooltip.tsx b/src/components/Tooltip/EducationalTooltip/BaseEducationalTooltip.tsx index 81c76c77150f..304282b79f76 100644 --- a/src/components/Tooltip/EducationalTooltip/BaseEducationalTooltip.tsx +++ b/src/components/Tooltip/EducationalTooltip/BaseEducationalTooltip.tsx @@ -1,3 +1,4 @@ +import {useNavigation} from '@react-navigation/native'; import React, {memo, useEffect, useRef, useState} from 'react'; import type {LayoutRectangle, NativeSyntheticEvent} from 'react-native'; import GenericTooltip from '@components/Tooltip/GenericTooltip'; @@ -16,6 +17,8 @@ function BaseEducationalTooltip({children, shouldRender = false, ...props}: Educ const [shouldMeasure, setShouldMeasure] = useState(false); const show = useRef<() => void>(); + const navigation = useNavigation(); + useEffect(() => { return () => { hideTooltipRef.current?.(); @@ -39,6 +42,13 @@ function BaseEducationalTooltip({children, shouldRender = false, ...props}: Educ }; }, [shouldMeasure, shouldRender]); + useEffect(() => { + const unsubscribe = navigation.addListener('blur', () => { + hideTooltipRef.current?.(); + }); + return unsubscribe; + }, [navigation]); + return (