             Lanes.Vendor.ReactWidgets.Combobox
         props = _.omit(@props, 'label')
         select = <Component
+            ref="select"
+            open={@state.isOpen}
+            onToggle={@onToggle}
+            onSelect={@onSelect}
+            suggest={true}
             data={@_getChoices()}
             valueField="id"
             textField="label"
             onChange={@onChange}
             name={@props.name}
+            {...props}
             value={@getCurrentSelection().id}
-            {...props} />
+            />
 
         if @props.unstyled
             select

class Lanes.Components.SelectField extends Lanes.React.Component
    mixins: [ Lanes.Components.Form.FieldMixin ]

    getDefaultProps: ->
        labelField: 'name', idField: 'id'

    propTypes:
        collection: Lanes.PropTypes.Collection
        labelField: React.PropTypes.string
        getSelection: React.PropTypes.func
        setSelection: React.PropTypes.func

    dataObjects:
        collection: ->
            @props.collection || (
                @props.model?.associations.collectionFor(@props.name).fetch()
            )

    componentWillMount: ->
        @collection.ensureLoaded()

    onChange: (selections) ->
        selections = [selections] unless _.isArray(selections)
        records = _.map selections, (selection) =>
            @collection.get(selection.id)

            @model.set(@props.name, value)
        true

    getCurrentModel: ->
        @model.associations.getModelFromCollection(@model, @props.name, @collection)

    getCurrentSelection: ->
        return @props.getSelection(@model) if @props.getSelection

        selected = @getCurrentModel()

        if selected
            {id: selected[@props.idField], label: selected[@props.labelField]}
        else
            {id: null, label: ''}


    renderDisplayValue: ->
        <span>{@getCurrentSelection()?.label}</span>

    _getChoices: ->
        if @state.isOpen
            if _.isFunction(@getChoices) then @getChoices() else
                labelField = @props.labelField
                @collection.map (model) ->
                    {id: model.id, label: _.result(model, labelField)}
        else
            selection = @getCurrentSelection()
            if selection then [selection] else []

    onToggle: (isOpen) ->
        @collection.fetch(limit: @props.displayLimit) if isOpen
        @setState({isOpen})

    renderEdit: (label) ->
        Component = if @props.multi
