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.

zIndex has no effect

See original GitHub issue

Using iOS simulator the dropdowns are going behind my other text inputs on the screen when open. I’ve set the zIndex as high as 50000 with no luck.

<DropDownPicker items={[ { label: "1", value: 1 }, { label: "2", value: 2 }, { label: "3", value: 3 }, { label: "4", value: 4 }, { label: "5", value: 5 }, ]} containerStyle={{ marginHorizontal: 12, marginVertical: 10, flex: 1, width: "50%", }} zIndex={50000} defaultNull placeholder="Total Courts" onChangeItem={(item) => console.log(item.label, item.value)} />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
leslielyjcommented, May 26, 2020

Hey guys, zIndex still does not work as of v2.1.3, however you can put zIndex as a style in a View component:

<View style={{zIndex: 99999}}>
          <DropDownPicker
            items={[
              {label: '1', value: 1},
              {label: '2', value: 2},
              {label: '3', value: 3},
            ]}
            containerStyle={{height: 40, width: "20%",flex: 1}}
            
            onChangeItem={item => this.setState({ no_of_people: item.value })}
            dropDownMaxHeight={100}
          />
</View>

@plaporte @hossein-zare

3reactions
FaysalBsatacommented, May 18, 2021

I think the problem occurs when nesting in a scrollview!

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 reasons your z-index isn't working (and how to fix it)
Check that the elements have their position set and z-index numbers in the correct order. Make sure that you don't have parent elements...
Read more >
Why does z-index not work? - Stack Overflow
Essentially, as long as the element isn't position: static (the default setting) it is considered positioned and z-index will work. Many answers ...
Read more >
Why your z-index isn't working - DEV Community ‍ ‍
By default, every element has a position of static. z-index only works on positioned elements (relative, absolute, fixed, sticky) so if you set ......
Read more >
CSS Z-Index Not Working? How to Fix It Using Stack Order
The z-index property of CSS is a tricky one. It won't work easily by itself if you don't know how to use it...
Read more >
CSS Z-Index Not Working! Send Help!
TL;DR: the most common cause for z-index not working is not explicitly declaring a CSS position value (i.e. position: relative, absolute, ...
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