xcarpentier / rn-tourguide

🚩Make an interactive step by step tour guide for your react-native app (a rewrite of react-native-copilot)
https://xcarpentier.github.io/rn-tourguide/
Other
711 stars 212 forks source link

Tooltip is shown for a split second, disappears, and then only showing properly #11

Open wegory opened 3 years ago

wegory commented 3 years ago

The default tooltip flickers before fading in. Moving this.state.opacity.setValue(0) to before this.props.next() solved it for me. Not sure if it causes any problems elsewhere.

xcarpentier commented 3 years ago

Can you provide a PR ?

McSam94 commented 3 years ago

is this issue fixed?

palaganaskurl commented 2 years ago

Experiencing the same issue. Any fix for this?

[EDIT] Moving this.state.opacity.setValue(0) to before this.props.next() solved it for me. Not sure if it causes any problems elsewhere. (WORKED FOR ME)

Lecklark commented 2 years ago

Go into node_modules/rn-tourguide/lib/components/Modal.js. In this.handleNext function add this.state.opacity.setValue(0) before this.props.next().

leecrossley commented 2 years ago

Here is the diff:

diff --git a/node_modules/rn-tourguide/lib/components/Modal.js b/node_modules/rn-tourguide/lib/components/Modal.js
index f848302..e1d65dd 100644
--- a/node_modules/rn-tourguide/lib/components/Modal.js
+++ b/node_modules/rn-tourguide/lib/components/Modal.js
@@ -26,6 +26,7 @@ let Modal = (() => {
                 this.layout = layout;
             };
             this.handleNext = () => {
+               this.state.opacity.setValue(0);
                 this.props.next();
             };
             this.handlePrev = () => {
@@ -130,7 +131,7 @@ let Modal = (() => {
                 delay: duration,
                 useNativeDriver: true,
             });
-            this.state.opacity.setValue(0);
+
             if (toValue !== this.state.tooltipTranslateY._value &&
                 !((_a = this.props.currentStep) === null || _a === void 0 ? void 0 : _a.keepTooltipPosition)) {
                 Animated.parallel([translateAnim, opacityAnim]).start();

You can use https://www.npmjs.com/package/patch-package as it doesn't look like this is getting updated any time.