AutoComplete dropdown in ios is not scrollable
See original GitHub issueI can’t scroll my drop down list in ios but in android i can. I checked a lot of suggestions and nothing doesn’t help.
this is my code `return ( <View style={styles.container}> {showAddChar && ( <Text style={styles.addChar} onPress={this.onChoosenItem}> + </Text> )} <Autocomplete data={data} defaultValue={query} onChangeText={(text: string) => this.setState({ query: text, hideResult: false }) } keyExtractor={index => index[‘id’].toString()} inputContainerStyle={styles.inputContainerStyle} listContainerStyle={{}} listStyle={styles.listStyle} style={{ fontSize: 18 }} hideResults={hideResult} placeholder={placeholder} renderItem={({ item }) => ( <TouchableOpacity style={styles.item} onPress={() => this.onChoosenItem(item)} > <Text>{item[‘name’]}</Text> </TouchableOpacity> )} /> </View> ); } }
const styles = StyleSheet.create({ container: { left: 0, position: ‘absolute’, right: 0, top: 0 }, addChar: { zIndex: 1, position: ‘absolute’, fontSize: 30, right: 0, top: 0 }, inputContainerStyle: { borderColor: ‘rgb(70, 48, 235)’, borderBottomWidth: 3, borderTopWidth: 0, borderRightWidth: 0, borderLeftWidth: 0 }, // listContainerStyle: {height:filteredMembers.length * 70}, listStyle: { borderColor: ‘grey’, margin: 0, overflow: ‘scroll’, maxHeight: 200 }, item: { fontSize: 16, borderBottomColor: ‘grey’, borderBottomWidth: 2, padding: 12 } });`
***** that what i get in IOS
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Hey, @tayloraleach I could fix the scrolling issue in Android and iOS by following https://github.com/mrlaessig/react-native-autocomplete-input/issues/64#issuecomment-507388606 logic and by sending listStyle={{ maxHeight: 350 }} prop to AutoComplete Input.
The solutions suggested here didn’t work for me, the solution that worked:
flex: 1
to listContainerStyle which is the parent of FlatList.