Skip to content

Commit c04e083

Browse files
committed
release v0.0.4
1 parent ebcc11f commit c04e083

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v0.0.4 - Tue, 11 Nov 2014 16:08:14 GMT
2+
--------------------------------------
3+
4+
- [e57bab5](../../commit/e57bab5) [fixed] Issue with focus being lost - closes #9
5+
6+
17
v0.0.3 - Fri, 31 Oct 2014 19:25:20 GMT
28
--------------------------------------
39

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-modal",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"homepage": "https://github.com/rackt/react-modal",
55
"authors": [
66
"Ryan Florence",

dist/react-modal.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ var Modal = module.exports = React.createClass({
5151
ariaAppHider.toggle(props.isOpen, props.appElement);
5252
}
5353
sanitizeProps(props);
54-
this.portal = React.renderComponent(ModalPortal(props), this.node);
54+
if (this.portal)
55+
this.portal.setProps(props);
56+
else
57+
this.portal = React.renderComponent(ModalPortal(props), this.node);
5558
},
5659

5760
render: function () {
@@ -63,7 +66,6 @@ function sanitizeProps(props) {
6366
delete props.ref;
6467
}
6568

66-
6769
},{"../helpers/ariaAppHider":3,"../helpers/injectCSS":5,"./ModalPortal":2}],2:[function(_dereq_,module,exports){
6870
var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null);
6971
var div = React.DOM.div;
@@ -137,8 +139,10 @@ var ModalPortal = module.exports = React.createClass({
137139
},
138140

139141
maybeFocus: function() {
140-
if (this.props.isOpen)
142+
if (this.props.isOpen &&
143+
!this.refs.content.getDOMNode().contains(document.activeElement)) {
141144
this.focusContent();
145+
}
142146
},
143147

144148
focusContent: function() {
@@ -164,8 +168,8 @@ var ModalPortal = module.exports = React.createClass({
164168
},
165169

166170
handleKeyDown: function(event) {
167-
if (event.key == 9 /*tab*/) scopeTab(this.getDOMNode(), event);
168-
if (event.key == 27 /*esc*/) this.requestClose();
171+
if (event.keyCode == 9 /*tab*/) scopeTab(this.getDOMNode(), event);
172+
if (event.keyCode == 27 /*esc*/) this.requestClose();
169173
},
170174

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

178182
requestClose: function() {
179-
if (this.ownerHandlesClose)
183+
if (this.ownerHandlesClose())
180184
this.props.onRequestClose();
181185
},
182186

@@ -220,7 +224,6 @@ var ModalPortal = module.exports = React.createClass({
220224
}
221225
});
222226

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

0 commit comments

Comments
 (0)