-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
bringSubviewToFront ADD style properties for view … #1891
Conversation
bringSubviewToFront: ReactPropTypes.bool, sendSubviewToBack: ReactPropTypes.bool,
Can you design an API closer to z-index? I'm not sure if we want z-index exactly because the stacking context rules get complex but I'm almost certain that exposing bringSubviewToFront as a prop is too inflexible and confusing e.g. consider multiple views that set the prop. |
Create something like zIndex is a not a good idea because you have to reorder all and you will lost performance. If i had to do a zIndex i need a liitle bit help to retrive styleproperty from an UIView OR parse the DOM from react @ide Can you help me for that ? |
I'm not too concerned about performance at this point -- we need to design a good API first. Perhaps someone with extensive experience with stacking layers can chime in. |
There are a lot of issues to consider when thinking about z-indexing, I believe this would work best right now as an external library until a comprehensive solution is ready. |
If performance is a concern, a possible alternative approach would be to set the In any case, I agree with @ide, exposing bringToFront/sendToBack seems like the wrong abstraction. |
Alright let me change my method. |
Agreed this isn't the right API and z-index is fraught with potential issues. There is no DOM in ReactNative of course, but on the web componentDidMount should be called after renering to the DOM. We'd like to make it work the same way in ReactNative such that once the native view is rendered comonentDidMount is called, but we haven't gotten around to doing that. Usually what we do now is use requestAnimationFrame to perform operations after the component has rendered in native. |
I'm going to close this PR for now. Feel free to put up a new one if you can come up with something awesome that is more like a z-index API. |
ADD style properties for view …
bringSubviewToFront: ReactPropTypes.bool,
sendSubviewToBack: ReactPropTypes.bool,