             onClick: @dismissEditor
             onMouseDown: @handleClickStart
             onMouseUp: @handleClickEnd
-            ref: (element) => @overlay = element
+            ref: @overlay
 
             div className: 'beatmapset-description-editor__container osu-page',
               el BBCodeEditor,

export class Info extends React.Component
  constructor: (props) ->
    super props

    @state =
      isBusy: false

  # likewise, starting on an inner element end ending on the outer element will still use the outer element as the event target.
  dismissEditor: (e) =>
    @setState isEditing: false if e.button == 0 &&
                                  e.target == @overlay.current &&
                                  @clickEndTarget == @clickStartTarget


