Skip to content

Commit

Permalink
[fixed] shift+tab
Browse files Browse the repository at this point in the history
closes #23
  • Loading branch information
mzabriskie committed Mar 24, 2015
1 parent bb218ca commit f86de0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
},

Expand All @@ -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)
Expand All @@ -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({
Expand Down

0 comments on commit f86de0a

Please sign in to comment.