Skip to content

Commit

Permalink
Release v3.5.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Jul 4, 2018
1 parent c3e06ab commit 4377cc8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v3.5.1 - Wed, 04 Jul 2018 10:22:38 UTC
--------------------------------------

- [c3e06ab](../../commit/c3e06ab) [added] additional data attributes.
- [e5a80d6](../../commit/e5a80d6) [fixed] portal node will be reparented if necessary on props change


v3.4.5 - Fri, 01 Jun 2018 11:11:21 UTC
--------------------------------------

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": "3.4.5",
"version": "3.5.1",
"homepage": "https://github.com/reactjs/react-modal",
"authors": [
"Ryan Florence",
Expand Down
16 changes: 8 additions & 8 deletions dist/react-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,6 @@ var Modal = function (_Component) {
this.node.className = portalClassName;
}

// Stop unnecessary renders if modal is remaining closed
if (!prevProps.isOpen && !isOpen) return;

var prevParent = snapshot.prevParent,
nextParent = snapshot.nextParent;

Expand All @@ -620,6 +617,9 @@ var Modal = function (_Component) {
nextParent.appendChild(this.node);
}

// Stop unnecessary renders if modal is remaining closed
if (!prevProps.isOpen && !isOpen) return;

!isReact16 && this.renderPortal(this.props);
}
}, {
Expand Down Expand Up @@ -701,6 +701,7 @@ Modal.propTypes = {
shouldReturnFocusAfterClose: _propTypes2.default.bool,
parentSelector: _propTypes2.default.func,
aria: _propTypes2.default.object,
data: _propTypes2.default.object,
role: _propTypes2.default.string,
contentLabel: _propTypes2.default.string,
shouldCloseOnEsc: _propTypes2.default.bool,
Expand Down Expand Up @@ -1775,9 +1776,9 @@ var ModalPortal = function (_Component) {
return typeof additional === "string" && additional ? className + " " + additional : className;
};

_this.ariaAttributes = function (items) {
_this.attributesFromObject = function (prefix, items) {
return Object.keys(items).reduce(function (acc, name) {
acc["aria-" + name] = items[name];
acc[prefix + "-" + name] = items[name];
return acc;
}, {});
};
Expand Down Expand Up @@ -1887,9 +1888,7 @@ var ModalPortal = function (_Component) {
onClick: this.handleContentOnClick,
role: this.props.role,
"aria-label": this.props.contentLabel
}, this.ariaAttributes(this.props.aria || {}), {
"data-testid": this.props.testId
}),
}, this.attributesFromObject("aria", this.props.aria || {}), this.attributesFromObject("data", this.props.data || {})),
this.props.children
)
);
Expand Down Expand Up @@ -1931,6 +1930,7 @@ ModalPortal.propTypes = {
role: _propTypes2.default.string,
contentLabel: _propTypes2.default.string,
aria: _propTypes2.default.object,
data: _propTypes2.default.object,
children: _propTypes2.default.node,
shouldCloseOnEsc: _propTypes2.default.bool,
overlayRef: _propTypes2.default.func,
Expand Down
4 changes: 2 additions & 2 deletions dist/react-modal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-modal",
"version": "3.4.5",
"version": "3.5.1",
"description": "Accessible modal dialog component for React.JS",
"main": "./lib/index.js",
"module": "./lib/index.js",
Expand Down

0 comments on commit 4377cc8

Please sign in to comment.