« get me outta code hell

Fix bug in ContextMenu.clearItems - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-07-25 14:16:01 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-25 14:16:01 -0300
commitff828a89b40060519c8d1557c0b504242948b2fc (patch)
treef54f085a42d8efaffca590c69a01aceeed4b924f
parent1b6e2f7f6203ffccfe6f23a59ee2b5fbcad19191 (diff)
Fix bug in ContextMenu.clearItems
-rw-r--r--ui.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui.js b/ui.js
index a327b98..f686ba9 100644
--- a/ui.js
+++ b/ui.js
@@ -1493,12 +1493,12 @@ class ContextMenu extends FocusElement {
   }
 
   clearItems() {
-    for (const input of this.form.inputs) {
+    const inputs = this.form.inputs.slice()
+    for (const input of inputs) {
       this.form.removeInput(input)
     }
   }
 
-
   fixLayout() {
     let width = 10
     for (const input of this.form.inputs) {