Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix RNTooltip showing multiple tooltips

ammarahm-edf5e7e10dbf53
diff --git a/apps/mobile/src/utils/index.js b/apps/mobile/src/utils/index.js
index 61aa7901d..ac1947467 100755
--- a/apps/mobile/src/utils/index.js
+++ b/apps/mobile/src/utils/index.js
@@ -371,15 +371,19 @@ export const TOOLTIP_POSITIONS = {
TOP: 3,
BOTTOM: 4
};
-
+let prevTarget = null;
export function showTooltip(event, text, position) {
if (!event._targetInst?.ref?.current) return;
+ prevTarget && RNTooltips.Dismiss(prevTarget);
+ prevTarget = null;
+ prevTarget = event._targetInst.ref.current;
RNTooltips.Show(event._targetInst.ref.current, tabBarRef.current, {
text: text,
tintColor: 'black',
corner: 40,
textSize: 14,
- position: position
+ position: position,
+ duration: 1000
});
}