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

Commit 82693d8

Browse files
committed
Fix ArrowUp to properly skip over unselectable items
1 parent 9b4b196 commit 82693d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Autocomplete.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class Autocomplete extends React.Component {
306306
const { highlightedIndex } = this.state
307307
let index = highlightedIndex === null ? items.length : highlightedIndex
308308
for (let i = 0; i < items.length ; i++) {
309-
const p = (index - 1 + items.length) % items.length
309+
const p = (index - (1 + i) + items.length) % items.length
310310
if (this.props.isItemSelectable(items[p])) {
311311
index = p
312312
break

0 commit comments

Comments
 (0)