Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
fix: scroll support
Browse files Browse the repository at this point in the history
  • Loading branch information
elsangedy committed Oct 7, 2019
1 parent c329319 commit eb6a97a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/useDownshift.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ function useDownshift(params) {
})
}

if (!avoidScrollingRef && shouldScroll(previousState, previousParams)) {
if (
!avoidScrollingRef.current &&
shouldScroll(previousState, previousParams)
) {
scrollHighlightedItemIntoView()
}

Expand Down
2 changes: 1 addition & 1 deletion src/usePrevious.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRef, useEffect } from 'react'

function usePrevious(value) {
const ref = useRef()
const ref = useRef(value)

useEffect(() => {
ref.current = value
Expand Down

0 comments on commit eb6a97a

Please sign in to comment.