react-native-tooltips icon indicating copy to clipboard operation
react-native-tooltips copied to clipboard

Tooltip go off screen

Open Ilario17 opened this issue 4 years ago • 2 comments

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

Ilario17 avatar Nov 04 '20 18:11 Ilario17

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

armata99 avatar Mar 14 '21 07:03 armata99

I have same problem on ios if element close to screen edge image in Example folder image

St1ggy avatar Mar 23 '21 07:03 St1ggy