From 02a16ce3949d133d64b9f27c4705db6d130ed821 Mon Sep 17 00:00:00 2001 From: Clay Diffrient Date: Mon, 13 Mar 2017 19:22:00 -0600 Subject: [PATCH] release v1.7.3 --- CHANGELOG.md | 6 ++++++ bower.json | 2 +- dist/react-modal.js | 3 ++- dist/react-modal.min.js | 2 +- package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe05c39c..b6547f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +v1.7.3 - Tue, 14 Mar 2017 01:22:00 GMT +-------------------------------------- + +- [e1df119](../../commit/e1df119) [fixed] remove portal context in timeout (#353) + + v1.7.2 - Thu, 09 Mar 2017 03:59:52 GMT -------------------------------------- diff --git a/bower.json b/bower.json index ad631c54..d22d8445 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-modal", - "version": "1.7.2", + "version": "1.7.3", "homepage": "https://github.com/reactjs/react-modal", "authors": [ "Ryan Florence", diff --git a/dist/react-modal.js b/dist/react-modal.js index d394498a..9ff34f17 100644 --- a/dist/react-modal.js +++ b/dist/react-modal.js @@ -158,8 +158,9 @@ return /******/ (function(modules) { // webpackBootstrap this.portal.closeWithTimeout(); } + var that = this; setTimeout(function () { - this.removePortal(); + that.removePortal(); }, closesAt - now); } else { this.removePortal(); diff --git a/dist/react-modal.min.js b/dist/react-modal.min.js index 20b2c46d..2b125355 100644 --- a/dist/react-modal.min.js +++ b/dist/react-modal.min.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e()}var r=n(2),s=n(3),i=n(4),c=r.createFactory(n(5)),a=n(10),l=n(11),u=n(3).unstable_renderSubtreeIntoContainer,p=n(9),f=i.canUseDOM?window.HTMLElement:{},d=i.canUseDOM?document.body:{appendChild:function(){}},h=r.createClass({displayName:"Modal",statics:{setAppElement:function(e){d=a.setElement(e)},injectCSS:function(){console.warn("React-Modal: injectCSS has been deprecated and no longer has any effect. It will be removed in a later version")}},propTypes:{isOpen:r.PropTypes.bool.isRequired,style:r.PropTypes.shape({content:r.PropTypes.object,overlay:r.PropTypes.object}),portalClassName:r.PropTypes.string,appElement:r.PropTypes.instanceOf(f),onAfterOpen:r.PropTypes.func,onRequestClose:r.PropTypes.func,closeTimeoutMS:r.PropTypes.number,ariaHideApp:r.PropTypes.bool,shouldCloseOnOverlayClick:r.PropTypes.bool,parentSelector:r.PropTypes.func,role:r.PropTypes.string,contentLabel:r.PropTypes.string.isRequired},getDefaultProps:function(){return{isOpen:!1,portalClassName:"ReactModalPortal",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0,parentSelector:function(){return document.body}}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName;var e=o(this.props.parentSelector);e.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){var t=o(this.props.parentSelector),n=o(e.parentSelector);n!==t&&(t.removeChild(this.node),n.appendChild(this.node)),this.renderPortal(e)},componentWillUnmount:function(){this.props.ariaHideApp&&a.show(this.props.appElement);var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(function(){this.removePortal()},n-t)):this.removePortal()},removePortal:function(){s.unmountComponentAtNode(this.node);var e=o(this.props.parentSelector);e.removeChild(this.node),l(document.body).remove("ReactModal__Body--open")},renderPortal:function(e){e.isOpen?l(document.body).add("ReactModal__Body--open"):l(document.body).remove("ReactModal__Body--open"),e.ariaHideApp&&a.toggle(e.isOpen,e.appElement),this.portal=u(this,c(p({},e,{defaultStyles:h.defaultStyles})),this.node)},render:function(){return r.DOM.noscript()}});h.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},e.exports=h},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){var o;/*! +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactModal=t(require("react"),require("react-dom")):e.ReactModal=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e()}var r=n(2),s=n(3),i=n(4),c=r.createFactory(n(5)),a=n(10),l=n(11),u=n(3).unstable_renderSubtreeIntoContainer,p=n(9),f=i.canUseDOM?window.HTMLElement:{},d=i.canUseDOM?document.body:{appendChild:function(){}},h=r.createClass({displayName:"Modal",statics:{setAppElement:function(e){d=a.setElement(e)},injectCSS:function(){console.warn("React-Modal: injectCSS has been deprecated and no longer has any effect. It will be removed in a later version")}},propTypes:{isOpen:r.PropTypes.bool.isRequired,style:r.PropTypes.shape({content:r.PropTypes.object,overlay:r.PropTypes.object}),portalClassName:r.PropTypes.string,appElement:r.PropTypes.instanceOf(f),onAfterOpen:r.PropTypes.func,onRequestClose:r.PropTypes.func,closeTimeoutMS:r.PropTypes.number,ariaHideApp:r.PropTypes.bool,shouldCloseOnOverlayClick:r.PropTypes.bool,parentSelector:r.PropTypes.func,role:r.PropTypes.string,contentLabel:r.PropTypes.string.isRequired},getDefaultProps:function(){return{isOpen:!1,portalClassName:"ReactModalPortal",ariaHideApp:!0,closeTimeoutMS:0,shouldCloseOnOverlayClick:!0,parentSelector:function(){return document.body}}},componentDidMount:function(){this.node=document.createElement("div"),this.node.className=this.props.portalClassName;var e=o(this.props.parentSelector);e.appendChild(this.node),this.renderPortal(this.props)},componentWillReceiveProps:function(e){var t=o(this.props.parentSelector),n=o(e.parentSelector);n!==t&&(t.removeChild(this.node),n.appendChild(this.node)),this.renderPortal(e)},componentWillUnmount:function(){this.props.ariaHideApp&&a.show(this.props.appElement);var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);if(n){e.beforeClose||this.portal.closeWithTimeout();var o=this;setTimeout(function(){o.removePortal()},n-t)}else this.removePortal()},removePortal:function(){s.unmountComponentAtNode(this.node);var e=o(this.props.parentSelector);e.removeChild(this.node),l(document.body).remove("ReactModal__Body--open")},renderPortal:function(e){e.isOpen?l(document.body).add("ReactModal__Body--open"):l(document.body).remove("ReactModal__Body--open"),e.ariaHideApp&&a.toggle(e.isOpen,e.appElement),this.portal=u(this,c(p({},e,{defaultStyles:h.defaultStyles})),this.node)},render:function(){return r.DOM.noscript()}});h.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},e.exports=h},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){var o;/*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. diff --git a/package.json b/package.json index de094d28..b7f29031 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-modal", - "version": "1.7.2", + "version": "1.7.3", "description": "Accessible modal dialog component for React.JS", "main": "./lib/index.js", "repository": {