   displayName: 'ReactAutoCompleteSearchFactView'
 
   scrollIntoView: ->
-    $el = $(@refs.input.getDOMNode())
+    $el = $(@getDOMNode())
     scrollIntoViewWithinContainer $el, $el.parents('.auto-complete-search-list')
 
   render: ->

      model: fact
      query: @model().query
      selected: key == @state.selectedModelKey
      onMouseEnter: => @setState selectedModelKey: key
      onMouseLeave: => @setState selectedModelKey: null
      onClick: => @setState selectedModelKey: key; @props.onSelect?()

    else if key < 0 then @model().length - 1
    else key

  _select: (key) ->
    key = @_fixKeyModulo(key)
    @setState selectedModelKey: key
    @refs[key].scrollIntoView()

  moveSelectionUp: ->
    @_select if @state.selectedModelKey? then @state.selectedModelKey-1 else -1

  moveSelectionDown: ->
    @_select if @state.selectedModelKey? then @state.selectedModelKey+1 else 0

class window.AutoCompleteFactsView extends Backbone.Marionette.Layout
  className: "auto-complete"
