Skip to content

Commit

Permalink
Merge pull request #122 from react-component/fix-not-found-content-em…
Browse files Browse the repository at this point in the history
…pty-style

Fix dropdown style when notFoundContent is empty
  • Loading branch information
yiminghe committed Oct 12, 2016
2 parents 59ad5ed + 8d7e5a5 commit 93bcfb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions assets/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
position: absolute;
outline: none;

&:empty,
&-hidden {
display: none;
}
Expand Down
17 changes: 10 additions & 7 deletions src/DropdownMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,16 @@ const DropdownMenu = React.createClass({
},

render() {
return (<div
style={{ overflow: 'auto' }}
onFocus={this.props.onPopupFocus}
onMouseDown={preventDefaultEvent}
>
{this.renderMenu()}
</div>);
const renderMenu = this.renderMenu();
return renderMenu ? (
<div
style={{ overflow: 'auto' }}
onFocus={this.props.onPopupFocus}
onMouseDown={preventDefaultEvent}
>
{renderMenu}
</div>
) : null;
},
});

Expand Down

0 comments on commit 93bcfb7

Please sign in to comment.