From c901edf73067a3c8d5c17026fd93f3e39fe74499 Mon Sep 17 00:00:00 2001 From: Nikolay Lanets Date: Fri, 27 Apr 2018 13:02:42 +0300 Subject: [PATCH] Allow not render menu --- lib/Autocomplete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index 1658c8bb..5766f85b 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -474,13 +474,13 @@ class Autocomplete extends React.Component { minWidth: this.state.menuWidth, } const menu = this.props.renderMenu(items, this.props.value, style) - return React.cloneElement(menu, { + return menu ? React.cloneElement(menu, { ref: e => this.refs.menu = e, // Ignore blur to prevent menu from de-rendering before we can process click onTouchStart: () => this.setIgnoreBlur(true), onMouseEnter: () => this.setIgnoreBlur(true), onMouseLeave: () => this.setIgnoreBlur(false), - }) + }) : null; } handleInputBlur(event) {