-
-
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
[Popover] Fix rendering for nested Menus #3806
Conversation
material-ui/issues/3586 changed `<noscript>` to `<div>` to resolve an issue with react-event-listener and nested `<noscript>` That change broke layout for nested Menus. This change fixes that.
@@ -380,7 +380,7 @@ const Popover = React.createClass({ | |||
|
|||
render() { | |||
return ( | |||
<div> | |||
<div style={{display: 'none'}}> |
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.
What about moving the style object outside of the render method in a getStyles
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.
I wondered, but seemed like overkill given there are no other styles in that component.
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.
Good point, or having a ?
const styles = {
root: {
display: 'none',
},
};
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.
Either way, it was a lot of extra lines for a one-line fix, and an unnecessary abstraction. We're never going to add more styles, so I vote to leave it, but if it really bothers you that much, I'll change it. 😄
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 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.
Interesting rule 👍
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.
@sibelius if you were to submit a PR following this rule I wouldn't object.
@mbrookes Thanks 👍. |
tests/ docs demo, and is linted.[Popover] Invariant Violation: findComponentRoot(...) from unclosed <noscript> #3586 changed
<noscript>
to<div>
to resolve an issue with react-event-listener and nested
<noscript>
That change broke layout for nested
Menu
s. This change fixes that.Closes #3802.