diff --git a/dist/index.js b/dist/index.js index 6e3b789..57448d4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45,7 +45,7 @@ function enhanceWithClickOutside(Component) { key: 'handleClickOutside', value: function handleClickOutside(e) { var domNode = this.__domNode; - if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') { + if ((!domNode || (domNode.contains ? !domNode.contains(e.target) : !domNode.base.contains(e.target))) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') { this.__wrappedInstance.handleClickOutside(e); } } diff --git a/index.js b/index.js index 614f4aa..b494442 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,10 @@ function enhanceWithClickOutside(Component: React.ComponentType<*>) { handleClickOutside(e) { const domNode = this.__domNode; if ( - (!domNode || !domNode.contains(e.target)) && + (!domNode || + (domNode.contains + ? !domNode.contains(e.target) + : !domNode.base.contains(e.target))) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function' ) {