Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created September 30, 2017 10:01
Show Gist options
  • Select an option

  • Save hanipcode/a9ee6b7dfdecd04e5db9db60be46452c to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/a9ee6b7dfdecd04e5db9db60be46452c to your computer and use it in GitHub Desktop.
//rest of code
const styles = StyleSheet.create({
FloatingContainer: {
position: 'absolute',
alignSelf: 'stretch',
top: 55,
left: 0,
right: 0,
marginHorizontal: 22,
borderWidth: 2,
borderColor: '#aaa',
elevation: 4,
borderBottomLeftRadius: 10,
borderBottomRightRadius: 10,
backgroundColor: '#FFF'
},
AutoCompleteResultList: {
elevation: 1,
flexGrow: 1,
alignSelf: 'stretch'
},
//..rest of code
});
//..rest of code
class AutoCompleteResultList extends Component {
//..rest of code
render() {
if (this.props.data.length === 0) {
return <View />;
}
return (
<View style={styles.FloatingContainer}>
<FlatList
{...this.props}
contentContainerStyle={styles.AutoCompleteResultList}
renderItem={itemValue => this.renderItem(itemValue)}
/>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment