Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for incorrect value of tooltipDuplicate for original children #186

Open
SyedTayyabUlMazhar opened this issue Sep 6, 2023 · 0 comments

Comments

@SyedTayyabUlMazhar
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

In situations where you have nested Tooltip whose isVisible is false, while the parent's is true. The nested context consumer will get tooltipDuplicate true. A fix for this problem is to also wrap the original children in Context.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-walkthrough-tooltip/src/tooltip.js b/node_modules/react-native-walkthrough-tooltip/src/tooltip.js
index 3098692..326f949 100644
--- a/node_modules/react-native-walkthrough-tooltip/src/tooltip.js
+++ b/node_modules/react-native-walkthrough-tooltip/src/tooltip.js
@@ -486,7 +486,9 @@ class Tooltip extends Component {
             onLayout={this.measureChildRect}
             style={this.props.parentWrapperStyle}
           >
-            {children}
+            <TooltipChildrenContext.Provider value={{ tooltipDuplicate: false }}>
+              {children}
+            </TooltipChildrenContext.Provider>
           </View>
         ) : null}
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant