« get me outta code hell

fix jump-to cancel being very broken - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2020-09-16 13:28:28 -0300
committer(quasar) nebula <towerofnix@gmail.com>2020-09-16 13:28:28 -0300
commit82b243df1a54eaf4be83faa2ac6fbe2a33ffe4bf (patch)
tree7b865844aee8e691f84f9746d36166091e00d14f
parente0d244aad8e1e125fba5e297a115233148afa8af (diff)
fix jump-to cancel being very broken
-rw-r--r--ui.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/ui.js b/ui.js
index 5a801de..4b45bc9 100644
--- a/ui.js
+++ b/ui.js
@@ -2059,15 +2059,17 @@ class GrouplikeListingElement extends Form {
   }
 
   hideJumpElement(isCancel) {
-    if (isCancel) {
-      this.form.curIndex = this.oldFocusedIndex
-      this.form.scrollSelectedElementIntoView()
-    }
-    this.jumpElement.visible = false
-    if (this.jumpElement.isSelected) {
-      this.root.select(this)
+    if (this.jumpElement.visible) {
+      if (isCancel) {
+        this.form.curIndex = this.oldFocusedIndex
+        this.form.scrollSelectedElementIntoView()
+      }
+      this.jumpElement.visible = false
+      if (this.jumpElement.isSelected) {
+        this.root.select(this)
+      }
+      this.fixLayout()
     }
-    this.fixLayout()
   }
 
   unselected() {