allows the Portal HOC root element to receive a style props. This allows coordinate runtime positioning of the portal element using top/left/bottom/right values (#1502)

old
Pablo Lacerda de Miranda 2017-07-13 11:43:14 -07:00 committed by Javi Velasco
parent 6290cf5ab2
commit 0e299a65b1
1 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ class Portal extends Component {
children: PropTypes.node,
className: PropTypes.string,
container: PropTypes.node,
style: PropTypes.style,
}
static defaultProps = {
@ -55,7 +56,11 @@ class Portal extends Component {
_getOverlay() {
if (!this.props.children) return null;
return <div className={this.props.className}>{this.props.children}</div>;
return (
<div className={this.props.className} style={this.props.style}>
{this.props.children}
</div>
);
}
_renderOverlay() {