Skip to content

Commit

Permalink
[fixed] Issue with focus being lost - closes reactjs#9
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabriskie committed Nov 10, 2014
1 parent 07541b3 commit e57bab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ var ModalPortal = module.exports = React.createClass({
},

maybeFocus: function() {
if (this.props.isOpen)
if (this.props.isOpen &&
!this.refs.content.getDOMNode().contains(document.activeElement)) {
this.focusContent();
}
},

focusContent: function() {
Expand Down Expand Up @@ -109,7 +111,7 @@ var ModalPortal = module.exports = React.createClass({
},

requestClose: function() {
if (this.ownerHandlesClose)
if (this.ownerHandlesClose())
this.props.onRequestClose();
},

Expand Down Expand Up @@ -152,4 +154,3 @@ var ModalPortal = module.exports = React.createClass({
);
}
});

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"karma-mocha": "0.1.3",
"mocha": "1.20.1",
"react": ">=0.11.0",
"react-tap-event-plugin": "git://github.com/appsforartists/react-tap-event-plugin",
"reactify": "^0.14.0",
"rf-release": "0.3.1",
"uglify-js": "2.4.15",
Expand Down

0 comments on commit e57bab5

Please sign in to comment.