« get me outta code hell

Fix keyPressed call order - tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-09-15 15:38:09 -0300
committerFlorrie <towerofnix@gmail.com>2018-09-15 15:38:11 -0300
commitb03a59e8cf545aa3ae61a91e76f5cefa4f0c3701 (patch)
tree94f08ccdb8a6987a49c029de0217277bb980e0b6 /ui
parentcaf3398a3029bc852545ddd5f6584fb9cf3a4929 (diff)
Fix keyPressed call order
Before: <top>, <bottom>, <second to bottom>, <third to bottom>...
Now: <top>, <second to top>, <third to top>, <fourth to top>...
Diffstat (limited to 'ui')
-rw-r--r--ui/Root.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/Root.js b/ui/Root.js
index 7e031d3..b2514ce 100644
--- a/ui/Root.js
+++ b/ui/Root.js
@@ -27,7 +27,7 @@ module.exports = class Root extends DisplayElement {
   handleData(buffer) {
     if (this.selectedElement) {
       const els = [
-        ...this.selectedElement.directAncestors, this.selectedElement].reverse()
+        this.selectedElement, ...this.selectedElement.directAncestors]
       for (const el of els) {
         if (el instanceof FocusElement) {
           const shouldBreak = (el.keyPressed(buffer) === false)