Skip to content

Commit e57bab5

Browse files
committed
[fixed] Issue with focus being lost - closes #9
1 parent 07541b3 commit e57bab5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: lib/components/ModalPortal.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ var ModalPortal = module.exports = React.createClass({
7070
},
7171

7272
maybeFocus: function() {
73-
if (this.props.isOpen)
73+
if (this.props.isOpen &&
74+
!this.refs.content.getDOMNode().contains(document.activeElement)) {
7475
this.focusContent();
76+
}
7577
},
7678

7779
focusContent: function() {
@@ -109,7 +111,7 @@ var ModalPortal = module.exports = React.createClass({
109111
},
110112

111113
requestClose: function() {
112-
if (this.ownerHandlesClose)
114+
if (this.ownerHandlesClose())
113115
this.props.onRequestClose();
114116
},
115117

@@ -152,4 +154,3 @@ var ModalPortal = module.exports = React.createClass({
152154
);
153155
}
154156
});
155-

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"karma-mocha": "0.1.3",
3535
"mocha": "1.20.1",
3636
"react": ">=0.11.0",
37-
"react-tap-event-plugin": "git://github.com/appsforartists/react-tap-event-plugin",
3837
"reactify": "^0.14.0",
3938
"rf-release": "0.3.1",
4039
"uglify-js": "2.4.15",

0 commit comments

Comments
 (0)