react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Absolutely positioned Touchable Opacity isn't correctly positioned when in centrally aligned container
If you position a TouchableOpacity like this:
<View style={{ position: 'relative', height: 300, backgroundColor: 'red' }} >
<TouchableOpacity
style={{
position: 'absolute',
right: 0
}}
>
<View style={{ height:50, width: 50, backgroundColor: "green"}} />
</TouchableOpacity>
</V>
the Touchable aligns correctly to the right:
However if I add alignItems
to the container, the Touchable aligns in the wrong place:
<View
style={{
position: 'relative',
height: 300,
backgroundColor: 'red',
alignItems: 'center'
}}
>
<TouchableOpacity
style={{
position: 'absolute',
right: 0
}}
>
<View style={{ height: 50, width: 50, backgroundColor: 'green' }} />
</TouchableOpacity>
</View>
I'm on version 1.7.0. If I swap with the react-native
TouchableOpacity
it positions correctly