Skip to content
Permalink
Browse files

Scroll combobox to highlighted item (#499)

  • Loading branch information...
jongsue authored and mshwery committed Mar 10, 2019
1 parent 6dc8e4b commit 38be9cc6e95342c57ea7803f666f8a13f33ce441
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/autocomplete/src/Autocomplete.js
@@ -212,8 +212,8 @@ export default class Autocomplete extends PureComponent {
inputValue,
getItemProps,
selectedItem,
highlightedIndex,
selectItemAtIndex,
highlightedIndex,
getRootProps,
...restDownshiftProps
}) => (
@@ -234,7 +234,9 @@ export default class Autocomplete extends PureComponent {
inputValue,
getItemProps,
selectedItem,
highlightedIndex,
highlightedIndex: this.props.items.includes(selectedItem)
? this.props.items.indexOf(selectedItem)
: 0,
selectItemAtIndex
})
}}
@@ -252,7 +254,9 @@ export default class Autocomplete extends PureComponent {
},
inputValue,
selectedItem,
highlightedIndex,
highlightedIndex: this.props.items.includes(selectedItem)
? this.props.items.indexOf(selectedItem)
: 0,
selectItemAtIndex,
...restDownshiftProps
})

0 comments on commit 38be9cc

Please sign in to comment.
You can’t perform that action at this time.