       return if toggleElement and toggleElement[0].contains(event.target)
 
       @closeDropdown()
+
+    onKeydown: (evt) =>
+      if evt.which is 27 # Esc
+        @openScope.focusToggleElement()
+        @closeDropdown()
 
     closeDropdown: (event) =>
       @openScope.$apply =>

      if @openScope is dropdownScope
        @openScope = null
        @$document.unbind('click', @onClick)

    onClick: (event) =>
      # This method may still be called during the same mouse event that

    open: (dropdownScope) =>
      unless @openScope
        @$document.bind('click', @onClick)
        @$document.bind('keydown', @onKeydown)
      @openScope.isOpen = false  if @openScope and @openScope isnt dropdownScope
      @openScope = dropdownScope

