-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
dialog render-to-layer version #2129
Conversation
@@ -45,27 +46,26 @@ const Overlay = React.createClass({ | |||
autoLockScrolling: React.PropTypes.bool, | |||
show: React.PropTypes.bool, | |||
transitionEnabled: React.PropTypes.bool, | |||
style: React.PropTypes.object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
carelessness - merging from #1845 by hand... apologies
4521d70
to
a7566df
Compare
@oliviertassinari - rebasing this wasn't as the warning have moved completely, so git merge had a bad day at the office. I've manually rolled in your changes. Can I suggest no further changes to |
}, | ||
|
||
getDefaultProps() { | ||
return { | ||
show:true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the show
property be required instead of adding a default value?
@@ -39,36 +40,35 @@ const Overlay = React.createClass({ | |||
componentWillReceiveProps (nextProps, nextContext) { | |||
let newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme; | |||
this.setState({muiTheme: newMuiTheme}); | |||
if (this.state.show !== nextProps.show) { | |||
this.setState({show:nextProps.show}, this._applyAutoLockScrolling); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is two setState
call. Do you if this will have an impact on perf?
Actually, it looks like we don't need to have show
in the state.
Can't we just use the show
property?
@oliviertassinari - your'e right, state not required, have removed :) |
@@ -134,6 +131,16 @@ const Overlay = React.createClass({ | |||
if (!this.props.autoLockScrolling) this._allowScrolling(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed the function call to this method.
So I think that we can remove preventScrolling
and allowScrolling
method.
This component is also used by LeftNav
, I have just checked, it should be fine.
I think that it will also be good to move _allowScrolling
and _preventScrolling
inside _applyAutoLockScrolling
since their are only called by this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
componentWillUnmount
calls _allowScrolling, had a think about combining, but think its best to keep this separate. Does that sound ok?
@chrismcv I think that I'm done with my comments and that we can soon merge 😄. |
365e81b
to
c01336d
Compare
@oliviertassinari - |
I have noticed one issue. When we open the dialog for a second time, the height is not correct. |
@oliviertassinari apologies - rebase caused some confusion there, hence open and close. I had another rebase issue so manually merged it (see b4b7bb9). Does this fix your height issue? |
@chrismcv The height issue is gone, great work 👍! |
[Dialog] Use render-to-layer component
This PR created a wrapped dialog component that uses the render to layer component to put the dialog in a separate dom tree.
The reason for the wrapping is so that refs can continue to be used as normal within the dialog component for animation.
(This doesn't depend on the #2043 branch)