-setValue = (picker, value, items) ->
+setValue = (picker, value, items, cause = 'api') ->
   newVal = undefined
   for item in items
     if item is value or (hx.isObject(item) and (item.value is value or item.value is value?.value))


    @menu.on 'change', 'hx.picker', (item) =>
      if item?.content?
        @current = item.content
        @selectedText.text(@current.text or @current)
        @menu.hide()
        @emit 'change', {
          value: @current
          cause: 'user'
        }

    if not @options.renderer?
      @options.renderer = @menu.renderer()

    picker.current = newVal
    picker.emit 'change', {
      value: newVal
      cause: cause
    }

class Picker extends hx.EventEmitter
