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

[Popover] Fix rendering for nested Menus #3806

Merged
merged 1 commit into from
Mar 25, 2016
Merged

[Popover] Fix rendering for nested Menus #3806

merged 1 commit into from
Mar 25, 2016

Conversation

mbrookes
Copy link
Member

to resolve an issue with react-event-listener and nested <noscript>

That change broke layout for nested Menus. This change fixes that.

Closes #3802.

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'}}>
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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',
  },
};

Copy link
Member Author

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. 😄

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting rule 👍

Copy link
Member Author

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.

@oliviertassinari
Copy link
Member

@mbrookes Thanks 👍.

@mbrookes mbrookes deleted the menu-fix-nested branch December 16, 2016 21:12
@zannager zannager added component: Popover The React component. component: menu This is the name of the generic UI component, not the React module! labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! component: Popover The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Menu] Nested menu visual issues
4 participants