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

When Dropdown opens, dropdown container not taking z index, its not on the top of the below view #562

Open
sagarkbluebenz opened this issue May 27, 2022 · 12 comments

Comments

@sagarkbluebenz
Copy link

Dropdown container forcing below content go down when opens dropdown. not able to apply z index

@pedrogs97
Copy link

pedrogs97 commented May 27, 2022

Try this:

<View style={{ zIndex: 100 }}>
   <DropDownPicker {...} />
</View>

@carlossalasamper
Copy link

I have the same issue here
image

@lucasuracosta
Copy link

Same for me. It happens only when the dropdown opens to the bottom

@lucasuracosta
Copy link

lucasuracosta commented Jul 1, 2022

Try this:

<View style={{ zIndex: 100 }}>
   <DropDownPicker {...} />
</View>

¡This worked for me!

@kongshu612
Copy link

Hi there,

            <TouchableOpacity style={_style} onPress={__onPress} onLayout={__onLayout} {...props} ref={onRef} pointerEvents={pointerEvents} disabled={disabled} testID={testID}>
                {_BodyComponent}
                {_ArrowComponent}
            </TouchableOpacity>
            {DropDownBodyComponent}
        </View>

Is it reasonable that we only apply the ZIndex to the DropDownBodyComponent?

@challme28
Copy link

<View style={{ zIndex: 100 }}>
<DropDownPicker {...} />

This hasn't work for me either

@devioand-aj
Copy link

I fixed this problem from #450 (comment)

@challme28
Copy link

Understanding the following helped me achieve the desired out in React Native
The way React Native zIndex hierarchy works is as follows:

<ComponentA>
  <Children1 zIndex={99}/>
  <Children2/>
<ComponentA/>
<ComponentB>
  <Children3/>
  <Children4 zIndex={9}/>
<ComponentB/>

Children1 will always render below Children3 and Children4. Children4 is able to render on top of Children3. Should Children3 have a Child with a zIndex equal to 999, it would still render below Children4.

@durgesh94
Copy link

Try this:

<View style={{ zIndex: 100 }}>
   <DropDownPicker {...} />
</View>

If trying this,
on android devices the list is not scrolling, working fine on iOS devices.

@Linh-Vo
Copy link

Linh-Vo commented Mar 13, 2023

still didn't work on IOS

@sharived
Copy link

I'm still having this issue. If the dropDownDirection is Bottom then no matter where I set my zIndex it's always behind my other inputs. If I set it to Top it works fine. Very frustrating....

@hoon25
Copy link

hoon25 commented Oct 25, 2024

If you're using the Dropdown component inside a FlatList, it seems that the height(z-index) is set according to the rendering order of the FlatList, and it cannot be changed using z-index. Although it's not a perfect solution, I resolved the issue by reversing the order of the FlatList's data and applying the {flexDirection: 'column-reverse'} property!

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