diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index ee820065..3079cada 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -18,6 +18,8 @@ var CLASS_NAMES = { } }; +var OVERLAY_STYLES = { position: 'fixed', left: 0, right: 0, top: 0, bottom: 0 }; + function stopPropagation(event) { event.stopPropagation(); } @@ -102,7 +104,7 @@ var ModalPortal = module.exports = React.createClass({ }, handleKeyDown: function(event) { - if (event.keyCode == 9 /*tab*/) scopeTab(this.getDOMNode(), event); + if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content.getDOMNode(), event); if (event.keyCode == 27 /*esc*/) this.requestClose(); }, @@ -126,8 +128,6 @@ var ModalPortal = module.exports = React.createClass({ return !this.props.isOpen && !this.state.beforeClose; }, - overlayStyles: { position: 'fixed', left: 0, right: 0, top: 0, bottom: 0 }, - buildClassName: function(which) { var className = CLASS_NAMES[which].base; if (this.state.afterOpen) @@ -142,7 +142,7 @@ var ModalPortal = module.exports = React.createClass({ div({ ref: "overlay", className: cx(this.buildClassName('overlay'), this.props.overlayClassName), - style: this.overlayStyles, + style: OVERLAY_STYLES, onClick: this.handleOverlayClick }, div({