Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listStyle doesn't exist #263

Open
ScopeSV opened this issue May 3, 2023 · 4 comments
Open

listStyle doesn't exist #263

ScopeSV opened this issue May 3, 2023 · 4 comments

Comments

@ScopeSV
Copy link

ScopeSV commented May 3, 2023

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
Copy link
Author

ScopeSV commented May 3, 2023

I ended up just styling it directly inside renderItem

@jmd005-vendeesh
Copy link

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

@thiago-lcarvalho
Copy link

Still no listStyle?

@mrlaessig
Copy link
Collaborator

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>
    ),
  }}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants