byteburgers / react-native-autocomplete-input

Pure javascript autocomplete input for react-native
https://byteburgers.com/autocomplete
MIT License
805 stars 255 forks source link

listStyle doesn't exist #263

Open ScopeSV opened 1 year ago

ScopeSV commented 1 year ago

Hi, checking out this library. The rendered list items have a very short height, which makes it very hard to press the correct item.

According to the docs here on GitHub there should be a listStyle prop, but I can't find anything about it anywhere in the code.

How may I adjust the height of the items?

Thanks!

ScopeSV commented 1 year ago

I ended up just styling it directly inside renderItem

vendeeshwaranc commented 1 year ago

Try this https://www.npmjs.com/package/react-native-select-dropdown-search

thiago-lcarvalho commented 1 year ago

Still no listStyle?

mrlaessig commented 1 year ago

Applying styles to the result list can by done through flatListProps.styles:

<Autocomplete
  // ...
  flatListProps={{
    keyboardShouldPersistTaps: 'always',
    keyExtractor: (movie: Movie) => movie.episodeId,
    style: styles.customList, // <-- apply custom list styles here
    renderItem: ({ item }) => (
      <TouchableOpacity onPress={() => setQuery(item.title)}>
        <Text style={styles.itemText}>{item.title}</Text>
      </TouchableOpacity>
    ),
  }}
/>