-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Why doesn't support zIndex? #698
Comments
Thank you very much! : ) |
Well i know it's closed but it's very useful to have these properties bringSubviewToFront and inverse See The PR #1891 |
The problem with changing the order in which you draw items is that it can have unexpected results on animation. |
Anyone know how to control the draw order without reordering siblings?
|
One way to deal with the problems that are created by automatically overlaying subsequent elements over previous ones would be to implement the flex order element. This way, you could have an element with a lower z-index easily appear after an element with a higher z-index. |
Flex order seems like a great idea cc @vjeux. Anyone want to contribute a PR and some tests to the CSS-layout repo? |
flex order would not suffice layering to some extend. I got two list view. Overlapping each other. The list view which is below won't scroll at all as it being overlapped by high order. I gave a shot by making position: absolute and giving top and bottom a value. it did not work, so was wondering, if any one can show me a way to this mystery. |
Can you add it to https://productpains.com/product/react-native/, so that we can track it and see how popular this is. Thanks! |
I know this is closed, but this is preventing something as simple as a dropdown from being implementable? The only way I can think of doing one is to have 1 single View at the bottom of all my other views that happens to hold my options, that I move around across the app depending on which drop-down might need it. That seems really hacky. |
I am in the same boat. I have a deeply nested component that needs to render an overlay. Conceptually, it makes sense to handle the generation of this overlay and its contents, and the handling of open close, all within this component. However, due to the zindex issue, it is impossible to get it to render on top because it is so deeply nested. To overcome this, I have to move the generation and rendering functionality into a separate component higher up in the tree, while keeping the trigger functionality in the deeply nested component. However, multiple nested components need this overlay, with different options, so it begins to turn into a mess. The app is losing separation of concerns. |
Yes, however, I still run into this issue. Between my top-most layer and my bottom-most layer of the component tree, there are multiple components in-between that are bound to be positioned Therefore, applying |
@joncursi That's how the web works too. I suggest you create a portal component at the root which renders your components. |
Does this work for Animated.View? I'm having a strange issue: http://stackoverflow.com/questions/40326822/drag-drop-and-swap-items-animation It works for simple cases e.g.:
but have no idea what's wrong for the animation. (Dragging should put it on top) The color change works, so I'd assume the zIndex should. |
@AndrewNoh In your scenario, you need to change |
@aleclarson Thank you so much. Seems like I had a pretty big misunderstanding about how zIndex works. 👍 |
I have a dropdown Menu which is being overlapped by text view, zIndex does not work ` import React, { Component } from 'react'; import DropDown, { import { StackNavigator } from 'react-navigation'; //=======navigation optionpane========// constructor(props) {
} componentDidMount() { _getOptionList() { _canada(province) {
} renderA() { renderB() {
} renderC() {
} render() {
}
}, inputWrap: {
}, set: {
} |
@khushdeepkaur In the future, consider creating a Gist when you have a lot of code to share. Also, you should open a new issue. This is an issue about perceived lack of support for |
I build a component, but i can not set z-index
invariant violation: 'zIndex' is not a valid style property
. @vjeuxThanks!
The text was updated successfully, but these errors were encountered: