 
     if @state.focus
       children = @refs.suggestions.getDOMNode().children
-      for child, index in children when child.classList.contains "active"
-        child.classList.remove "active"
-        query = child.getAttribute "id"
+      for child, index in children when child.classList.contains 'active'
+        child.classList.remove 'active'
+        query = child.getAttribute 'id'
         break
 
-    if key_ascii is 13 and query isnt ""
+    if key_ascii is 13 and query isnt ''
       for key, label of @state.suggestions when query.toLowerCase() is label.toLowerCase()
         suggestion = {"#{key}": label}
         break

      values = value
      setTimeout (=> @props.onChange? @), 10
    @setState focus: false, values: values
    @refs.input.setValue if @props.multiple then "" else value[key]

  _getSuggestions: (query) ->
    suggestions = {}

        index = if index >= children.length - 1 then 0 else index + 1
      else
        index = if index is 0 then children.length - 1 else index - 1
      children[index].classList.add 'active'

  onBlur: (event) ->
    setTimeout (=> @setState focus: false, suggestions: {}), 300

  onSelect: (event) ->
    key = event.target.getAttribute 'id'
    @_addValue {"#{key}": @state.suggestions[key]}

  onRefreshSelection: (event) ->
    children = @refs.suggestions.getDOMNode().children
    for child, index in children when child.classList.contains 'active'
      child.classList.remove 'active'
      break

  onDelete: (event) ->
    delete @state.values[event.target.getAttribute 'id']
    @setState focus: false, values: @state.values
    @props.onChange? @

