question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem showing list on Android

See original GitHub issue

I’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.

Screen Shot 2019-07-05 at 17 35 26

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:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
braianjcommented, Jul 5, 2019

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 it

0reactions
stale[bot]commented, Apr 14, 2021

Closing 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found