       @remote.execute()
 
     if @options.filterable
-      @dropdown.find(".dropdown-input-field").focus()
+      @filterInput.focus()
 
   hidden: =>
     if @options.filterable

  PAGE_TWO_CLASS = "is-page-two"
  ACTIVE_CLASS = "is-active"

  constructor: (@el, @options) ->
    self = @
    @dropdown = $(@el).parent()
    search_fields = if @options.search then @options.search.fields else [];

    if @options.data
      # If data is an array
      if _.isArray @options.data
        @parseData @options.data
      else
        # Remote data

        if self.options.clicked
          self.options.clicked()

  $: (selector) ->
    $(selector, @dropdown)

  toggleLoading: ->
    $('.dropdown-menu', @dropdown).toggleClass LOADING_CLASS

