Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Allow not render menu #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down