react-native-tip
react-native-tip copied to clipboard
The tip image is duplicated only on Android devices
This is only happening on android devices when i click on the button that is wrapped in <Tip>. 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:
I think It's happening because of the {this.renderItem()} on tipProvider.js
Could you check on this? Thanks!
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,
Is this fixed in the latest 0.0.19?