Problem showing list on Android
See original GitHub issueI’m using version 4.1.0. The problem is that with iOS works as it should but in android it’s not showing at all, like the image.
The problem is when I set the autocomplete inside a card This is part of the code
import React from 'react';
import {
Alert,
ScrollView,
StyleSheet,
View,
Text,
TouchableOpacity,
TouchableHighlight,
Keyboard } from 'react-native';
import { Card, Button } from 'react-native-elements';
import Autocomplete from 'react-native-autocomplete-input';
import Colors from '../constants/Colors';
import { getClientes } from '../services/ClientesService';
import { LabelInput } from "../components/labelInput";
import { getTubos, getLoadedTubos } from '../services/TubosService';
import { SwipeList } from "../components/SwipeList";
export default class RemitosScreen extends React.Component {
static navigationOptions = {
title: 'Nuevo Remito',
};
constructor (props) {
super(props);
this.state = {
query: '',
client_id: '',
clientsData: [],
clientInfo: '',
tubosInfo: [],
tubosCargados: [],
tubosCliente: [],
tuboEntrega: '',
tubosEntrega: [],
tuboRetiro: '',
tubosRetiro: [],
observacion: '',
};
}
componentWillMount() {
this._getAllTubos();
this._getLoadedTubos();
this._restoreClients();
}
_filterData = (queryClient) => {
if (queryClient === '') {
return [];
}
let clientsData = this.state.clientsData;
const regex = new RegExp(`${queryClient.trim()}`, 'i');
return clientsData.filter(client => client.stringSearchable.search(regex) >= 0 );
};
render() {
const {
query,
clientInfo,
client_id,
tuboEntrega,
tubosEntrega,
TuboRetiro,
TubosRetiro } = this.state;
const data = this._filterData(query);
let comp = (a, b) => a.toLowerCase().trim() === b.toLowerCase().trim();
return (
<View style={styles.container}>
<View style={styles.clientContainer}>
<Card title='Cliente' containerStyle={{height: 400}}>
<Autocomplete
data={data.length === 1 && comp(query, data[0].nombre) ? [] : data}
defaultValue={query}
placeholder="Buscar Cliente"
inputContainerStyle={styles.autoContainer}
onChangeText={text => this.setState({ query: text })}
renderTextInput={props => <LabelInput {...props} autoCorrect={false} editable={(this.state.client_id=='')} />}
keyExtractor={item => item.id.toString() }
listStyle={{position: 'relative'}}
renderItem={({ item }) => (
<TouchableOpacity onPress={() => this._selectedClient(item)}>
<Text style={styles.itemText}>
{item.nombre}
</Text>
</TouchableOpacity>
)}
/>
</Card>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.secondaryBackground,
flexDirection: 'column'
},
clientContainer: {
flex: 1,
paddingBottom: 20,
},
movesContainer: {
flex: 2,
paddingBottom: 20,
},
buttonSaveContainer: {
marginTop: 20,
},
buttonSave: {
backgroundColor: Colors.tintColor,
},
newSearchContainer: {
marginTop: 20
},
buttonNewSearch: {
borderColor: Colors.tintColor
},
titleButtonNewSearch: {
color: Colors.tintColor
},
itemText: {
fontSize: 15,
margin: 5,
padding: 10,
backgroundColor: Colors.mainBackground,
color: Colors.tintColor,
height: 40,
},
autoContainer: {
borderWidth: 0,
height: 40,
},
});
I need some help here
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
Google app won't display search results - Android
Select Google App. Under "Storage," tap Manage space and then Clear Google search data. To check if you get results, try your search...
Read more >Apps Not Showing on Android Home Screen? 8 Fixes! - iMobie
This post explains why your apps are not showing on the home screen and offers 8 effective solutions to bring your missing apps...
Read more >15 common Android problems and how to fix them - CNET
15 common Android problems and how to fix them ... First, go back to the last page on this list and try clearing...
Read more >12 fast fixes for common Android problems - Computerworld
Solve annoying issues and get any phone in tip-top shape with these easy-to-implement, expert-approved solutions.
Read more >7 Solutions to Solve Android Device Does Not Show Up In ...
Here are seven solutions to solve Android device does not show up in ADB devices list on a Windows computer.Gears I use:Velbon Sherpa...
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 Free
Top 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
Ok, I find out that autocomplete should be wrapped into a
<View>
but if the excede the view size, it’s not a problem for iOS but it’s a problem android. It shows the list but can’t touch itClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.