()
| 31 | } |
| 32 | |
| 33 | getClickAwayEvent () { |
| 34 | let fn = this._clickAwayEvent; |
| 35 | if (!fn) { |
| 36 | fn = (event) => { |
| 37 | let el = this.clickAwayTarget || ReactDOM.findDOMNode(this); |
| 38 | |
| 39 | // Check if the target is inside the current component |
| 40 | if (event.target !== el && !isDescendant(el, event.target)) { |
| 41 | if (this.onClickAway) { |
| 42 | this.onClickAway(); |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | this._clickAwayEvent = fn; |
| 47 | } |
| 48 | return fn; |
| 49 | } |
| 50 | }; |
no test coverage detected