                   e.preventDefault()
 
               for button, idx in toolbar_items
-                do (idx) =>
+                do (button, idx) =>
                   BUTTON
                     key: button.title or idx
                     ref: "toolbaritem-#{idx}"

        position: 'relative'

      onClick: (ev) -> 
        console.log 'high'
        # Catch any clicks within the editor area to prevent the 
        # toolbar from being hidden via the root level 
        # wysiwyg_editor state

                visibility: if wysiwyg_editor.showing != @props.editor_key then 'hidden'

              onFocus: (e) => 
                if !@local.focused_toolbar_item

                  if @local.focused_toolbar_item in [undefined, null]
                    @local.focused_toolbar_item = 0 
