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

###

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

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

    @state =
      showingSelector: false



  render: =>
    classNames = "#{@bn}"
    classNames += " #{@bn}--selecting" if @state.showingSelector

    div
      className: classNames
      ref: @ref
      div
        className: "#{@bn}__select"
        @renderItem
