Skip to content

Commit

Permalink
Shim the possibly-absent HTMLElement
Browse files Browse the repository at this point in the history
  • Loading branch information
misuba committed Mar 18, 2015
1 parent d053cf8 commit 6887b00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var ModalPortal = React.createFactory(require('./ModalPortal'));
var ariaAppHider = require('../helpers/ariaAppHider');
var injectCSS = require('../helpers/injectCSS');

var SafeHTMLElement = ExecutionEnvironment.canUseDOM ? window.HTMLElement : {};

var Modal = module.exports = React.createClass({

displayName: 'Modal',
Expand All @@ -15,7 +18,7 @@ var Modal = module.exports = React.createClass({
propTypes: {
isOpen: React.PropTypes.bool.isRequired,
onRequestClose: React.PropTypes.func,
appElement: React.PropTypes.instanceOf(HTMLElement),
appElement: React.PropTypes.instanceOf(SafeHTMLElement),
closeTimeoutMS: React.PropTypes.number,
ariaHideApp: React.PropTypes.bool
},
Expand Down

0 comments on commit 6887b00

Please sign in to comment.