The results of the first Autocomplete float behind the second Autocomplete field
See original GitHub issueIf you have two or more vertically stacked components, the results float behind those below (as well as my Picker components). zIndex
does not seem to help
renderItem({item, i, separators}) {
return (
<TouchableOpacity style={styles.acResult} key={i} onPress={() => this.onSelect(item)}>
<Text style={styles.acResultText}>
{item.label}
</Text>
</TouchableOpacity>
)
}
<View style={styles.autocompleteContainer}>
<Autocomplete
autoCapitalize="none"
autoCorrect={false}
keyExtractor={item => item.id}
data={this.findResult(this.state.query)}
placeholder={this.props.field.label}
defaultValue={this.state.query}
onChangeText={text => this.setState({query: text})}
renderItem={this.renderItem}
/>
</View>
My styles are:
acResult: {
zIndex:99999,
backgroundColor:Colors.snow,
},
acResultText: {
paddingVertical:5,
paddingLeft:5,
fontSize: 18,
backgroundColor:Colors.snow,
color:Colors.charcoal
},
autocompleteContainer: {
backgroundColor:Colors.snow,
flex: 1,
left: 0,
position: 'absolute',
right: 0,
top: 0,
zIndex: 1
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Autocomplete issue into bootstrap modal - Stack Overflow
So just add the class "ui-front" to the parent element and the autocomplete will be correctly displayed inside the modal. Share.
Read more >AutoComplete - Ant Design
AutoComplete is an input box with text hints, and users can type freely. The keyword is aiding input. Select is selecting among given...
Read more >HTML attribute: autocomplete - MDN Web Docs
The HTML autocomplete attribute lets web developers specify what if any permission the user agent has to provide automated assistance in ...
Read more >How To Create Autocomplete on an Input Field - W3Schools
Step 5) Initiate the Autocomplete Effect on "myInput": Example. Pass the countries array as the second parameter of the autocomplete function: <script>
Read more >autofill - CSS-Tricks
Notice how the autocompleted fields have a yellow background? That's how the browser styles a field when it contains auto-filled content. The : ......
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
@paritosh-yadav i solve this issue with any styling like ZIndex Follow this snippet Code
<View mainContainer> <AutoComplete/> <View> <AutoComplete/> <View> <AutoComplete/> <View ( if you want to add button any other component add in this view/> </View> </View> </View>
I hope this snippet will help you for solving this problem
@paritosh-yadav simply set the zIndex:10 to the below component(second autocomplete).