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

[fixed] maybeScrollItemIntoView exception when itemNode is not found #281

Closed
wants to merge 2 commits into from
Closed
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: 3 additions & 1 deletion lib/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ class Autocomplete extends React.Component {
if (this.isOpen() && this.state.highlightedIndex !== null) {
const itemNode = this.refs[`item-${this.state.highlightedIndex}`]
const menuNode = this.refs.menu
const foundItemNode = findDOMNode(itemNode)
if (!foundItemNode) return
scrollIntoView(
findDOMNode(itemNode),
foundItemNode,
findDOMNode(menuNode),
{ onlyScrollIfNeeded: true }
)
Expand Down