         not select.required or (annotation.value[i]?.value? and annotation.value[i]?.value isnt "")
 
   getInitialState: ->
-    optionsKeys: {}
     selectedOptions: []
 
   componentWillMount: ->

  handleFocus: ->
    @menus[0].focus()

  handleOptionsKeys: (i, value) ->
    {id, condition} = @props.task.selects[i]
    optionsKeys = @state.optionsKeys

    if i is 0 or i is '0'
      optionsKeys[id] = value
    else if value is null
      optionsKeys[id] = null
    else
      optionsKeys[id] = "#{optionsKeys[condition]};#{value}"
    @setState optionsKeys: optionsKeys

  getOptions: (i, optionsKey) ->
    select = @props.task.selects[i]
    optionsKey ?= if not select.condition? then '*' else @state.optionsKeys[select.condition]
    options = select.options[optionsKey]
    if options then options else []

  getDisabledAttribute: (i) ->
    {selects} = @props.task
    select = selects[i]
    condition = selects.filter (filterSelect) => filterSelect.id is select.condition
    conditionIndex = selects.indexOf(condition[0])
    optionsKeys = @state.optionsKeys

    if select.condition? and not @props.annotation.value[conditionIndex]
      return true
    if select.condition? and select.allowCreate is false and not select.options[optionsKeys[select.condition]]?.length
      return true
    false



  componentDidMount: ->
    annotationValues = @props.annotation.value
    unless annotationValues.length
      @props.annotation.value = @props.task.selects.map -> {value: null, option: false}

    if @props.autoFocus is true
