-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Re-calc menu width when props change. #1014
Conversation
@rolandpoulter - It looks like this PR broke the menu open/close transitions. |
@hai-cea from my end they appear to be working (Chrome), though they might not behave how they should describe by the design doc. What is it doing or not doing? I wouldn't have expected this one to break the transition, my other PR for menus touched that code. |
Is it the close transition that isn't working? |
Yes, the dropdown menu appears and disappears without transitions. I'm using chrome as well. |
cef7e90
to
327c952
Compare
It seems to work the first time, but stops after opening and closing a few times. I'll see if I can fix it. |
@hai-cea I have some questions about the I had the transitions working, but they weren't working smoothly until I took the calls to |
The animation doesn't do justice, it actually looks much smoother 😄 |
@@ -275,7 +280,6 @@ var Menu = React.createClass({ | |||
paddingRight: this.context.muiTheme.component.menuSubheader.padding | |||
}, | |||
hideable: { | |||
opacity: (this.props.visible) ? 1 : 0, |
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.
Menu would disappear mid animation with this.
@@ -60,6 +60,7 @@ let DropDownMenu = React.createClass({ | |||
}, | |||
|
|||
componentWillReceiveProps(nextProps) { | |||
if (this.props.autoWidth) this._setWidth(); |
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.
Adding this makes the DropDown button width update as well as the menu width.
@rolandpoulter I believe that may be a bug? I think Dom.withoutTransition() should save the current transition so that it can be restored at the end of the style mutation. |
I'll look into fixing that on Monday. My worry is that it will effect behaviors throughout the project. Should I work on that as part of this PR or should it be a separate PR? |
@rolandpoulter Thanks - I think it should be a separate PR. |
@hai-cea This method is currently only called in |
Re-calc menu width when props change.
Thanks @rolandpoulter |
For #805