« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index cf45a4b..04d5e3c 100644
--- a/ui.js
+++ b/ui.js
@@ -1119,6 +1119,18 @@ class ListingJumpElement extends Form {
     this.input.x = this.label.right
     this.input.w = this.contentW - this.input.x
   }
+
+  keyPressed(keyBuf) {
+    const val = super.keyPressed(keyBuf)
+    if (typeof val !== 'undefined') {
+      return val
+    }
+
+    // Don't bubble escape.
+    if (telc.isEscape(keyBuf)) {
+      return false
+    }
+  }
 }
 
 class PathElement extends ListScrollForm {
@@ -1635,6 +1647,7 @@ class ContextMenu extends FocusElement {
   keyPressed(keyBuf) {
     if (telc.isEscape(keyBuf) || telc.isBackspace(keyBuf)) {
       this.close()
+      return false
     } else {
       super.keyPressed(keyBuf)
     }