From f86de0ab2035fcee16cdca0746596c9bc13ca77f Mon Sep 17 00:00:00 2001 From: mzabriskie Date: Mon, 23 Mar 2015 18:05:11 -0600 Subject: [PATCH] [fixed] shift+tab closes #23 --- lib/components/ModalPortal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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({