 
 
   render: =>
-    classNames = "#{@bn} js-#{@bn}"
+    classNames = "#{@bn}"
     classNames += " #{@bn}--selecting" if @state.showingSelector
 
     div
       className: classNames
+      ref: @ref
       div
         className: "#{@bn}__select"
         @renderItem

  hideSelector: (e) =>
    return if e.button != 0
    return unless @state.showingSelector
    return if $(e.target).closest(".js-#{@bn}").length

    @setState showingSelector: false


###

import { a, i, div } from 'react-dom-factories'
import { createRef, PureComponent } from 'react'

export class SelectOptions extends PureComponent
  constructor: (props) ->
    super props
    @bn = @props.bn ? 'select-options'
    @ref = createRef()

    @state =
      showingSelector: false
