         @close()
 
     handle_dialog_keyup : (evt) ->
-        evt.preventDefault() # which
-        evt.stopPropagation() # does
-        evt.nativeEvent.stopImmediatePropagation() # what ?!
-        search_mode = @props.search_str?.length > 0
         switch evt.keyCode
             when 13 #return
                 if @props.submittable
                     @submit()
             when 27 # ESC
-                if search_mode
-                    @props.actions.search('')
+                return true # will close the dialog
             when 38 # up
                 dir = -1
             when 40 # down
                 dir = +1
+            else
+                nothing = true
         if dir?
-            if search_mode
+            if @props.search_str?.length > 0 # active search
                 @props.actions.search_cursor(dir)
             else
                 @props.actions.select_cursor(dir)
+        evt.preventDefault() # which
+        evt.stopPropagation() # does
+        evt.nativeEvent.stopImmediatePropagation() # what ?!
         return false
 
     render : ->

            code  : @get('code')
            lang  : @get('lang')
            descr : @get('description')
    load_data: () ->
        if not DATA?
            require.ensure [], =>

            return true
        switch evt.keyCode
            when 27 # ESC
                if @props.search_str?.length > 0
                    @props.actions.search('')
                else
                    return true
            when 38
                @props.actions.search_cursor(-1)
            when 40
