Skip to content

Commit

Permalink
release v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Nov 11, 2014
1 parent ebcc11f commit c04e083
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v0.0.4 - Tue, 11 Nov 2014 16:08:14 GMT
--------------------------------------

- [e57bab5](../../commit/e57bab5) [fixed] Issue with focus being lost - closes #9


v0.0.3 - Fri, 31 Oct 2014 19:25:20 GMT
--------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-modal",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/rackt/react-modal",
"authors": [
"Ryan Florence",
Expand Down
17 changes: 10 additions & 7 deletions dist/react-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ var Modal = module.exports = React.createClass({
ariaAppHider.toggle(props.isOpen, props.appElement);
}
sanitizeProps(props);
this.portal = React.renderComponent(ModalPortal(props), this.node);
if (this.portal)
this.portal.setProps(props);
else
this.portal = React.renderComponent(ModalPortal(props), this.node);
},

render: function () {
Expand All @@ -63,7 +66,6 @@ function sanitizeProps(props) {
delete props.ref;
}


},{"../helpers/ariaAppHider":3,"../helpers/injectCSS":5,"./ModalPortal":2}],2:[function(_dereq_,module,exports){
var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null);
var div = React.DOM.div;
Expand Down Expand Up @@ -137,8 +139,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 All @@ -164,8 +168,8 @@ var ModalPortal = module.exports = React.createClass({
},

handleKeyDown: function(event) {
if (event.key == 9 /*tab*/) scopeTab(this.getDOMNode(), event);
if (event.key == 27 /*esc*/) this.requestClose();
if (event.keyCode == 9 /*tab*/) scopeTab(this.getDOMNode(), event);
if (event.keyCode == 27 /*esc*/) this.requestClose();
},

handleOverlayClick: function() {
Expand All @@ -176,7 +180,7 @@ var ModalPortal = module.exports = React.createClass({
},

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

Expand Down Expand Up @@ -220,7 +224,6 @@ var ModalPortal = module.exports = React.createClass({
}
});


},{"../helpers/focusManager":4,"../helpers/scopeTab":6}],3:[function(_dereq_,module,exports){
var _element = null;

Expand Down
Loading

0 comments on commit c04e083

Please sign in to comment.