title: React: How to use arrow up/down to select previous/next item in a scroll list and make the list scroll to keep the selected element on screen
body: <p>I'm using react-infinite scroll list and i'm implemented an arrow up/down handler: </p>
  
  <pre><code>onKeyDown = (e) =&gt; {
      if(e.keyCode === 40){
          if (this.props.onKeyDown) {
              e.preventDefault()
              this.props.onKeyDown()
          }
      }
      else if (e.keyCode === 38) {
          if (this.props.onKeyUp) {
              e.preventDefault()
              this.props.onKeyUp()
          }
      }
  }
  </code></pre>
  
  <p>(The component is reusable throughout my application so I pass the actual functions through props)</p>
  
  <p>This works as far as selecting the next/previous item in the list. But when you reach the edge of the scroll list and keep going, the list doesn't scroll to keep the selected item in view. The selected item just disappears off screen.</p>
  
  <p>Any help would be greatly appreciated!  </p>