diff --git a/android/src/main/java/px/tooltips/RNTooltipsModule.java b/android/src/main/java/px/tooltips/RNTooltipsModule.java index 8ae4112..e987ffb 100644 --- a/android/src/main/java/px/tooltips/RNTooltipsModule.java +++ b/android/src/main/java/px/tooltips/RNTooltipsModule.java @@ -19,6 +19,7 @@ public class RNTooltipsModule extends ReactContextBaseJavaModule { private final ReactApplicationContext reactContext; + private Callback _onHide = null; private ViewTooltip tooltip; public RNTooltipsModule(ReactApplicationContext reactContext) { @@ -51,6 +52,8 @@ public void run() { return; } + _onHide = onHide; + String text = props.getString("text"); int position = props.getInt("position"); int align = props.getInt("align"); @@ -105,7 +108,12 @@ public void run() { tooltip.onHide(new ViewTooltip.ListenerHide() { @Override public void onHide(View view) { - onHide.invoke(); + if (_onHide != null) { + _onHide.invoke(); + _onHide = null; + } + + return; } }); diff --git a/package.json b/package.json index 2a1fdff..03c1703 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-tooltips", - "version": "1.0.2", + "version": "1.0.3", "description": "React Native: Native Tooltip View", "main": "RNTooltips.js", "homepage": "https://github.com/prscX/react-native-tooltips.git",