react-native-tooltips
react-native-tooltips copied to clipboard
Tooltip go off screen
showTooltip(target, parent, text) {
RNTooltips.Show(
target,
parent,
{
text: text,
tintColor: '#ffffff',
textColor: '#4a4a4a',
textSize: 16,
duration: 1000,
corner: 8,
clickToHide: true,
autoHide: true,
duration: 3
}
)
}
<View ref={ref => this.parent = ref}>
<View>
<ScrollView>
<View>
<TouchableOpacity ref={ref => this.target = ref} onPress={() => this.showTooltip(this.target, this.parent, 'hello')}>
</TouchableOpacity>
</View>
</ScrollView>
<View>
</View>
I'm testing with iOS 14.1, I noticed that with some dimensions there are no problems, for example setting width: 200 on the parent, but on the same component putting width: 300 or width: '100%' the tooltip goes off screen
I have same problem on android, my screen is on landscape mode and the tooltip at the corner overlaps the OS soft keys.
It also has a small offset on LANDSCAPE_RIGHT
but its ok on the LANDSCAPE_LEFT
I have same problem on ios if element close to screen edge
in Example folder