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

bringSubviewToFront ADD style properties for view … #1891

Closed
wants to merge 2 commits into from
Closed

bringSubviewToFront ADD style properties for view … #1891

wants to merge 2 commits into from

Conversation

Iragne
Copy link
Contributor

@Iragne Iragne commented Jul 7, 2015

ADD style properties for view …

bringSubviewToFront: ReactPropTypes.bool,
sendSubviewToBack: ReactPropTypes.bool,

jean-alexandre iragne added 2 commits July 7, 2015 13:04
bringSubviewToFront: ReactPropTypes.bool,
sendSubviewToBack: ReactPropTypes.bool,
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 7, 2015
@Iragne Iragne changed the title Masterfb bringSubviewToFront ADD style properties for view … Jul 7, 2015
@ide
Copy link
Contributor

ide commented Jul 7, 2015

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.

@Iragne
Copy link
Contributor Author

Iragne commented Jul 7, 2015

Create something like zIndex is a not a good idea because you have to reorder all and you will lost performance.
However it's possible to rename it like sentToTop.

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 ?

@ide
Copy link
Contributor

ide commented Jul 7, 2015

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.

@brentvatne
Copy link
Collaborator

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.

@nicklockwood
Copy link
Contributor

If performance is a concern, a possible alternative approach would be to set the layer.zPosition, although that doesn't affect the order of touch processing, so potentially we could branch the implementation depending on the value of pointerEvents.

In any case, I agree with @ide, exposing bringToFront/sendToBack seems like the wrong abstraction.

@Iragne
Copy link
Contributor Author

Iragne commented Jul 8, 2015

Alright let me change my method.
@ide, @nicklockwood or @brentvatne do you knwn what in react is the method call when the dom is completly finish rendering ?

@sahrens
Copy link
Contributor

sahrens commented Jul 15, 2015

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.

@sahrens
Copy link
Contributor

sahrens commented Jul 15, 2015

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.

@sahrens sahrens closed this Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants