From c01b192a736c96a3daafcfa4db94850142d6b5eb Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 5 Jan 2018 19:02:35 +0100 Subject: [PATCH] Mark onClickOutside not required --- client/coral-framework/components/ClickOutside.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/coral-framework/components/ClickOutside.js b/client/coral-framework/components/ClickOutside.js index 054a9e6fe..ea60247ca 100644 --- a/client/coral-framework/components/ClickOutside.js +++ b/client/coral-framework/components/ClickOutside.js @@ -4,7 +4,8 @@ import {findDOMNode} from 'react-dom'; export default class ClickOutside extends Component { static propTypes = { - onClickOutside: PropTypes.func.isRequired + onClickOutside: PropTypes.func, + children: PropTypes.node, }; static contextTypes = { @@ -16,7 +17,7 @@ export default class ClickOutside extends Component { handleClick = (e) => { const {onClickOutside} = this.props; if (!e || !this.domNode.contains(e.target)) { - onClickOutside(e); + onClickOutside && onClickOutside(e); } };