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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tip image is duplicated only on Android devices #7

Open
MichaelAmadheo opened this issue Dec 23, 2022 · 2 comments
Open

The tip image is duplicated only on Android devices #7

MichaelAmadheo opened this issue Dec 23, 2022 · 2 comments

Comments

@MichaelAmadheo
Copy link

This is only happening on android devices when i click on the button that is wrapped in . It showing the duplicated button right below the wrapped button

This is the code:

<Tip
 id={tooltipId}
 body={FAVORITE.PRICE_MAY_CHANGE}
 bodyStyle={styles.tooltipCaption}
 active={false}
 onDismiss={() => this.dismissPriceTooltip(tooltipId)}
 tipContainerStyle={styles.tooltipStyle}
 overlayOpacity={-1}
>
 <TouchableOpacity onPress={() => this.showHidePriceTooltip(tooltipId)}>
  <Image
   source={toolTipIcon}
   style={styles.tooltipIcon}
  />
 </TouchableOpacity>
</Tip>

And this is the duplicated button on android:

Screenshot 2022-12-23 at 11 08 22

I think It's happening because of the {this.renderItem()} on tipProvider.js

Could you check on this? Thanks!

@sin2
Copy link

sin2 commented Feb 1, 2023

I was able to address this by removing the additional StatusBar.currentHeight offset.

Here is a patch of the changes.

diff --git a/node_modules/react-native-tip/src/utils.js b/node_modules/react-native-tip/src/utils.js
index 81438a8..5b10b1d 100644
--- a/node_modules/react-native-tip/src/utils.js
+++ b/node_modules/react-native-tip/src/utils.js
@@ -29,7 +29,7 @@ export function clearItemStyles(styles) {
 export async function getItemCoordinates(target) {
     const itemCoordinates = new Promise((resolve, reject) => {
         UIManager.measure(target, (x, y, width, height, px, py) => {
-            py = py + StatusBar.currentHeight
+            py = py
 
             const coords = {
                 width,

@MichaelAmadheo
Copy link
Author

Is this fixed in the latest 0.0.19?

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

2 participants