         @$el.addClass 'combobox'
         @small = options.small
 
-        @autocompleteWidget = @$el.data('ui-autocomplete')
+        @autocompleteWidget = @$el.data 'ui-autocomplete'
         @autocompleteWidget._renderItem = @renderItem
 
         isInput = @$el[0].nodeName.toLowerCase() is 'input'


    openMenu: =>
        @menuOpen = true
        @$el.addClass('expanded')
        @$el.focus().val(@value()).autocomplete 'search', ''

    onOpen: =>
        @menuOpen = true

    onClose: =>
        @menuOpen = false


    onSelect: (ev, ui) =>
        @$el.blur().removeClass 'expanded'
        @updateBadge ev, ui

    updateBadge: (ev, ui) =>
        @badge?.remove()
