                     title: button.title
                     value: if button.value then button.value 
                     onClick: if button.onClick then button.onClick
-                    onFocus: => @local.focused_toolbar_item = idx ; save @local
-                    onBlur: => 
+                    onFocus: (e) => 
+                      @local.focused_toolbar_item = idx; 
+                      save @local
+                      e.stopPropagation()
+
+                    onBlur: (e) => 
+                      e.stopPropagation()
                       @local.focused_toolbar_item = null 
+                      @local.just_unfocused = true
+                      setTimeout =>
+                        @local.just_unfocused = false 
+                      , 0
                       save @local 
 
                       # if the focus isn't still on an element inside of this menu, 

              id: 'editor'
              dangerouslySetInnerHTML:{__html: @props.html}
              'data-placeholder': if show_placeholder then @props.placeholder else ''
              onFocus: => 
                # Show the toolbar on focus
                # showing is global state for the toolbar to be 
                # shown. It gets set to null when someone clicks outside the 


      else

        DIV null,

          Dock
