SwipeRow isnt rendering left and right hidden menus the same.
See original GitHub issueHi! Thanks for trying out NativeBase! Due to the overwhelming requests and issues/questions we ask you to add the following details with your issue.
Please check the existing open/closed issues for a possible duplicate before creating a new issue 😃
Also DO fill out the below form to give us a better idea about your environment and help us debug it quicker. Issues without the required details will mostly be unattended to.
react-native, react and native-base version
"react": "16.3.1",
"react-native": "~0.55.2",
"native-base": "^2.4.5",
Expected behaviour
i would expect the swipe menu to show red, purple, blue, green on both left and right swipes. swiping right gives the expected behavior swiping left does not.
Actual behaviour
Part of red is shown then purple, blue, green, and then rest of red.
Steps to reproduce (code snippet or screenshot)
import {Text, Thumbnail,Button,Icon, SwipeRow } from 'native-base';
import { StyleSheet, View, TouchableHighlight, Image, Dimensions} from 'react-native';
const Card = (props) => {
let enrolleeThubnail = props.enrolleeImage;
return (
<View style={styles.Card} >
<SwipeRow
style={{ marginTop: -7, marginRight: -9, marginBottom: -7, backgroundColor: '#fafafa'}}
leftOpenValue={Dimensions.get("window").width *.8}
stopLeftSwipe={Dimensions.get("window").width * .8}
rightOpenValue={-Dimensions.get("window").width * .8}
stopRightSwipe={-Dimensions.get("window").width * .8}
left={
<View style={{flexDirection: 'row', width: '100%', height: '100%'}} >
<TouchableOpacity style={{backgroundColor: 'red', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Buzz')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'purple', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Vibrate')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'blue', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Locate')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'green', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Real Time')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
</View>
}
body={
<TouchableHighlight style={{ width: '100%', height: '100%'}} onPress={() => props.buttonPress()}>
<View style={styles.touchableCard} >
<Image style={styles.thumbnailIcon} source={require('../../../Images/iosDashboard.png')} />
<View style={styles.Info}>
<View style={{width: '60%'}}>
<Text style={styles.primaryText}>{props.Name}</Text>
<Text style={styles.text}>{props.primaryID}</Text>
<View style={{ flexDirection: 'row', justifyContent: 'flex-start', width: '100%'}}>
<Image style={styles.dIcon} source={require('../../../Images/Icon.png')} />
<Text style={styles.secondaryText}>{props.Assigned}</Text>
</View>
<Text style={styles.text}>{props.Date}</Text>
<Text style={styles.text}>{props.org}</Text>
</View>
</View>
<View style={{ width: '10%',flexDirection: 'column', justifyContent: 'center', alignItems: 'center'}}>
<Image source={require('../../../Images/32.png')} />
</View>
<Image style={{width: '15%', height: '100%'}} source={require('../../../Images/next.png')} />
</View>
</TouchableHighlight>
}
right={
<View style={{flexDirection: 'row', width: '100%', height: '100%'}} >
<TouchableOpacity style={{backgroundColor: 'red', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Buzz')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'purple', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Vibrate')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'blue', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Locate')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
<TouchableOpacity style={{backgroundColor: 'green', width: '25%', height: '100%', justifyContent: 'center', alignItems: 'center'}} onPress={() => alert('Real Time')}>
<Image style={{width: 25, height: 25}} source={require('../../../Images/smile.jpg')} />
</TouchableOpacity>
</View>
}
/>
</View>
);
}
const styles = StyleSheet.create({
Card: {
height: 110,
marginLeft: Dimensions.get("window").width * .025,
marginTop: 7,
width: '95%',
borderWidth: 1,
borderColor: '#fafafa',
},
touchableCard: {
flexDirection: 'row',
justifyContent: 'flex-start',
backgroundColor: '#fafafa',
height: '100%'
},
thumbnailIcon: {
height: 75,
width: 75,
height: 75,
borderRadius: 75 / 2,
borderColor: 'black',
borderWidth: 1,
marginTop: '5%',
marginLeft: 5,
},
dIcon: {
height: 24,
width: 24
},
Info: {
backgroundColor:"#fafafa",
paddingLeft: 10,
flex: 1,
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'flex-start',
},
text: {
fontSize: 14,
fontFamily: 'aller',
color: 'gray',
width: '100%'
},
primaryText: {
fontSize: 18,
fontFamily: 'aller',
fontWeight: 'bold',
width: '100%',
},
secondaryText: {
fontSize: 16,
fontWeight: 'bold',
width: '100%',
fontFamily: 'aller'
},
batteryIcon: {
height: 75,
width: 75,
height: 75,
borderRadius: 75 / 2,
borderColor: 'black',
borderWidth: 1,
marginTop: '5%',
marginLeft: 5,
}
});
export default (EnrolleeCard);
Screenshot of emulator/device
Is the bug present in both ios and android or in any one of them?
I’m only working with android
Any other additional info which would help us debug the issue quicker.
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Swipeable | React Native Gesture Handler - Software Mansion
It renders its children within a panable container allows for horizontal swiping left and right. While swiping one of two "action" containers can...
Read more >React Navigation TabNavigator swipe disabled: SwipeRow ...
When swiping left or right on that component it shows context menu, so I disabled the swiping Ability from the Tabs in android...
Read more >react-native-swipe-list-view-fix - npm
How to render a hidden row in a FlatList (renders behind the row). Should return a valid React Element. This is required unless...
Read more >A ListView With rows that Swipe Open and Closed - Morioh
How to render a hidden row in a FlatList (renders behind the row). Should return a valid React Element. This is required unless...
Read more >Components · Native Base Docs - Remicck
Header takes input as: Left , Body and Right . The components those are defined within Header will be rendered in the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@akhil-geekyants Thank you, your code is working for me thanks a lot…
@harikanammi Any updates on this?