Skip to content

Commit 0e299a6

Browse files
pablolmirandajavivelasco
authored andcommitted
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 (react-toolbox#1502)
1 parent 6290cf5 commit 0e299a6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/hoc/Portal.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Portal extends Component {
77
children: PropTypes.node,
88
className: PropTypes.string,
99
container: PropTypes.node,
10+
style: PropTypes.style,
1011
}
1112

1213
static defaultProps = {
@@ -55,7 +56,11 @@ class Portal extends Component {
5556

5657
_getOverlay() {
5758
if (!this.props.children) return null;
58-
return <div className={this.props.className}>{this.props.children}</div>;
59+
return (
60+
<div className={this.props.className} style={this.props.style}>
61+
{this.props.children}
62+
</div>
63+
);
5964
}
6065

6166
_renderOverlay() {

0 commit comments

Comments
 (0)