diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index da496f8d..54ad7c65 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -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() { @@ -109,7 +111,7 @@ var ModalPortal = module.exports = React.createClass({ }, requestClose: function() { - if (this.ownerHandlesClose) + if (this.ownerHandlesClose()) this.props.onRequestClose(); }, @@ -152,4 +154,3 @@ var ModalPortal = module.exports = React.createClass({ ); } }); - diff --git a/package.json b/package.json index 803629b1..71cfabe9 100644 --- a/package.json +++ b/package.json @@ -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",