Skip to content

Commit 8f3898a

Browse files
committed
Release v2.0.6.
1 parent 1676259 commit 8f3898a

File tree

5 files changed

+42
-15
lines changed

5 files changed

+42
-15
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
v2.0.6 - Tue, 20 Jun 2017 11:22:57 UTC
2+
--------------------------------------
3+
4+
- [07a2753](../../commit/07a2753) [fixed] check if the modal content is available when async update... (#1)
5+
- [cb6504c](../../commit/cb6504c) [fixed] Use bound ref functions
6+
- [7da6ec8](../../commit/7da6ec8) [fix] Unnecessary renders when modal is closed
7+
- [648cc2f](../../commit/648cc2f) [fixed] update script path on bootstrap example.
8+
- [6c780ae](../../commit/6c780ae) Update react-addons-test-utils to react-dom/test-utils
9+
- [385a8eb](../../commit/385a8eb) Update react dependencies
10+
- [8480042](../../commit/8480042) [chore] cache yarn when running on travis-ci.
11+
- [8d87599](../../commit/8d87599) [chore] added documentation for development.
12+
- [aaeb310](../../commit/aaeb310) [chore] added patterns on .gitignore.
13+
- [4ec7184](../../commit/4ec7184) [chode] Add table of contents
14+
- [96fdb90](../../commit/96fdb90) [chore] don't test on node versions < 6.x.y.
15+
- [20fcdc3](../../commit/20fcdc3) [chore] update README.md.
16+
- [4b57b2a](../../commit/4b57b2a) [chore] added script to regenerate all the changelog.
17+
- [21dc212](../../commit/21dc212) [chore] ask before publishing...
18+
- [2af9b89](../../commit/2af9b89) chore] improve publish docs commands.
19+
20+
121
v2.0.2 - Fri, 16 Jun 2017 13:10:06 UTC
222
--------------------------------------
323

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-modal",
3-
"version": "2.0.2",
3+
"version": "2.0.6",
44
"homepage": "https://github.com/reactjs/react-modal",
55
"authors": [
66
"Ryan Florence",

dist/react-modal.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,13 @@ return /******/ (function(modules) { // webpackBootstrap
188188
}, {
189189
key: 'componentWillReceiveProps',
190190
value: function componentWillReceiveProps(newProps) {
191-
if (newProps.isOpen) refCount.add(this);
192-
if (!newProps.isOpen) refCount.remove(this);
191+
var isOpen = newProps.isOpen;
192+
// Stop unnecessary renders if modal is remaining closed
193+
194+
if (!this.props.isOpen && !isOpen) return;
195+
196+
if (isOpen) refCount.add(this);
197+
if (!isOpen) refCount.remove(this);
193198
var currentParent = getParentElement(this.props.parentSelector);
194199
var newParent = getParentElement(newProps.parentSelector);
195200

@@ -1385,6 +1390,14 @@ return /******/ (function(modules) { // webpackBootstrap
13851390
_this.focusAfterRender = focus;
13861391
};
13871392

1393+
_this.setOverlayRef = function (overlay) {
1394+
_this.overlay = overlay;
1395+
};
1396+
1397+
_this.setContentRef = function (content) {
1398+
_this.content = content;
1399+
};
1400+
13881401
_this.afterClose = function () {
13891402
focusManager.returnFocus();
13901403
focusManager.teardownScopedFocus();
@@ -1416,7 +1429,7 @@ return /******/ (function(modules) { // webpackBootstrap
14161429
};
14171430

14181431
_this.focusContent = function () {
1419-
return !_this.contentHasFocus() && _this.content.focus();
1432+
return _this.content && !_this.contentHasFocus() && _this.content.focus();
14201433
};
14211434

14221435
_this.closeWithTimeout = function () {
@@ -1544,8 +1557,6 @@ return /******/ (function(modules) { // webpackBootstrap
15441557
}, {
15451558
key: 'render',
15461559
value: function render() {
1547-
var _this2 = this;
1548-
15491560
var _props = this.props,
15501561
className = _props.className,
15511562
overlayClassName = _props.overlayClassName,
@@ -1557,18 +1568,14 @@ return /******/ (function(modules) { // webpackBootstrap
15571568
return this.shouldBeClosed() ? _react2.default.createElement('div', null) : _react2.default.createElement(
15581569
'div',
15591570
{
1560-
ref: function ref(overlay) {
1561-
_this2.overlay = overlay;
1562-
},
1571+
ref: this.setOverlayRef,
15631572
className: this.buildClassName('overlay', overlayClassName),
15641573
style: _extends({}, overlayStyles, this.props.style.overlay),
15651574
onClick: this.handleOverlayOnClick },
15661575
_react2.default.createElement(
15671576
'div',
15681577
{
1569-
ref: function ref(content) {
1570-
_this2.content = content;
1571-
},
1578+
ref: this.setContentRef,
15721579
style: _extends({}, contentStyles, this.props.style.content),
15731580
className: this.buildClassName('content', className),
15741581
tabIndex: '-1',

dist/react-modal.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-modal",
3-
"version": "2.0.2",
3+
"version": "2.0.6",
44
"description": "Accessible modal dialog component for React.JS",
55
"main": "./lib/index.js",
66
"repository": {

0 commit comments

Comments
 (0)