« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui/Dialog.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/Dialog.js b/ui/Dialog.js
index f2db43d..85ff087 100644
--- a/ui/Dialog.js
+++ b/ui/Dialog.js
@@ -31,6 +31,7 @@ module.exports = class Dialog extends FocusElement {
 
   open() {
     this.opened()
+    this.oldSelectedElement = this.root.selectedElement
     this.visible = true
     this.root.select(this)
     this.fixLayout()
@@ -39,6 +40,7 @@ module.exports = class Dialog extends FocusElement {
   close() {
     this.closed()
     this.visible = false
+    this.root.select(this.oldSelectedElement)
   }
 
   opened() {}