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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Popover/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<EventListener
elementName="window"
onScroll={this.handleScroll}
Expand Down